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
Revision as of 23:33, 26 October 2017 by Sneak (talk | contribs) (Created page with "DNS blurb goes here == 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 ev...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

DNS blurb goes here

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. A dynamic DNS service stops you worrying about this, so the system will always be addressable from the same domain.

It's a lot more convenient to have a domain like server.mydomain.net that you can use to get to the server.

Getting a Domain

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.