We are still actively working on the spam issue.

Difference between revisions of "Setting up a Server/DNS"

From InstallGentoo Wiki
Jump to: navigation, search
(Domain Name)
(Running your own DNS server)
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
DNS blurb goes here
 
DNS blurb goes here
  
= Getting a Domain Name =
+
== 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. A dynamic DNS service stops you worrying about this, so the system will always be addressable from the same domain.
+
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.
 
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.
 
You have two real options for a domain, either buy one directly from a registrar or get a free one from FreeDNS or similar.
  
Line 16: Line 14:
 
* [https://namesilo.com Namesilo]
 
* [https://namesilo.com Namesilo]
 
You can use [https://tld-list.com TLD-List] to compare prices and features, and [https://www.domainhack.me/ domainhack.me] to help you come up with neat domain hacks (though all the good ones are already taken).
 
You can use [https://tld-list.com TLD-List] to compare prices and features, and [https://www.domainhack.me/ domainhack.me] to help you come up with neat domain hacks (though all the good ones are already taken).
 
  
 
=== [https://freedns.afraid.org/ FreeDNS] ===
 
=== [https://freedns.afraid.org/ FreeDNS] ===
Line 28: Line 25:
  
 
This will run at 9 AM every day. If you want logging check this [https://gist.github.com/kvieta/6040b9468a8b12772b5a6bd62f213992 Python Script with logging].
 
This will run at 9 AM every day. If you want logging check this [https://gist.github.com/kvieta/6040b9468a8b12772b5a6bd62f213992 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 with PowerDNS + [https://github.com/pboehm/ddns pboehm/ddns], or BIND/Yadifa + [https://github.com/SFTtech/sftdyn sftdyn], or [https://github.com/nsupdate-info/nsupdate.info nsupdate]
 +
*[[Setting up a Server/DNS#FreeDNS|FreeDNS]] though not recommended with your own domain
 +
*[https://nsupdate.info Hosted nsupdate] - privacy respecting, two minute set up
 +
*Free dynamic DNS from [https://www.1984hosting.com/product/freedns/ 1984] (privacy-conscious), [https://dns.he.net/ Hurricane Electric] (easy, flexible, fast, recommended), [https://www.cloudflare.com/dns/ Cloudflare] (just use HE-tier), [https://www.namecheap.com/store/domains/freedns/ Namecheap] (also a registrar)
 +
 +
= Running your own DNS server =
 +
 +
== Recursive ==
 +
A recursive DNS server forwards and caches results from authoritative servers. Most they can be configured to answer queries from local data too, but not as flexibly as authoritative servers.
 +
 +
*Unbound - high performance caching recursive DNS server
 +
*dnsmasq - Lightweight DNS forwarder available on most router software like OpenWRT. Can run with DHCP to map leases to domain names.
 +
 +
== 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
 +
*PowerDNS - probably the most extensible open source DNS server out there
 +
*Knot DNS - modern, easy to configure authorative-only DNS server
 +
 +
[[Category:Hardware]]
 +
[[Category:Software]]

Revision as of 17:59, 26 May 2022

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

Recursive

A recursive DNS server forwards and caches results from authoritative servers. Most they can be configured to answer queries from local data too, but not as flexibly as authoritative servers.

  • Unbound - high performance caching recursive DNS server
  • dnsmasq - Lightweight DNS forwarder available on most router software like OpenWRT. Can run with DHCP to map leases to domain names.

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
  • PowerDNS - probably the most extensible open source DNS server out there
  • Knot DNS - modern, easy to configure authorative-only DNS server