We are still actively working on the spam issue, the wiki may be restored to an earlier date and account creation may be disabled.

Setting up a Server/DNS

From InstallGentoo Wiki
Jump to: navigation, search

DNS blurb goes here

Getting a Domain Name

The primary identifier of your server on the internet is the IP address. Not only is it often a huge pain to memorize and type the IP every time, but if you're hosting from home your IP likely changes periodically. It's a lot more convenient to have a domain like server.mydomain.net that you can use to get to the server.

You have two real options for a domain, either buy one directly from a registrar or get a free one from FreeDNS or similar.

From a Registrar

Think of a domain, go to the registrar and buy. Most registrars provide their own DNS servers, but few offer dynamic DNS - if you require dynamic DNS see here. Many registrars offer whois guard to protect the personal info contained in whois records, though you can often just falsify the whois information if this isnt offered (OVH is a notable exception). Some recommendations:

You can use TLD-List to compare prices and features, and domainhack.me to help you come up with neat domain hacks (though all the good ones are already taken).

FreeDNS

Make a free account, then go to subdomains and click add. Type in what subdomain you want to use, and pick one of the free domains. For example, if you want your server to be called cocks, and you pick the domain chickenkiller.com, your server will be accessible at cocks.chickenkiller.com (although this one is probably taken already). If you don't know your servers external ip curl http://ident.me/ from a shell to get it.

Click save, and it should pop-up in your subdomains. After a few seconds, the URL should point to your server's IP. You can test with SSH, ping, or opening in a web browser depending on what you have working. However, if your IP should change, you will need to manually update it. For doing this easily, FreeDNS actually provides an API. If you click the "ASCII" link there, you should get a table of all your domains. At the end of each line is an address. Every time you load this address in a browser, the IP will get updated.

To update it automatically put this in your crontab (crontab -e)

0 9 * * * curl https://freedns.afraid.org/api/?action=getdyndns&sha=API_KEY_GOES_HERE

This will run at 9 AM every day. If you want logging check this Python Script with logging.

Dynamic DNS

A dynamic DNS service keeps a system addressable from the same domain regardless of IP address changes (e.g. dynamic IP from residential ISP if you're hosting from home). There are a few options for this:

Running your own DNS server

Authoritative

If you have domains of your own and want more flexibility than your registrar offers or just want to do it yourself this is the one you want. Recommended software:

  • Yadifa - Authoritative-only, very fast, runs the .eu tld zone
  • BIND - by far the most popular thanks to its age and proven reliability
  • Unbound - designed to replace bind, more modern/secure
  • PowerDNS - probably the most extensible open source DNS server out there