====== djbdns ====== * [[DNS]] * [[dnsip]] - simple lookup that returns IP address * [[dnsmx]] - print MX records of a domain * [[dnsname]] - lookup reverse ptr of an IP address * [[dnstxt]] - print ouf the TXT records of a domain * [[http://cr.yp.to/djbdns/run-server.html|How to run a DNS server]] * [[http://cr.yp.to/djbdns/tinydns-data.html|The tinydns-data program]] * [[http://www.vegadns.org/|Vega DNS]] djbdns also ships with a number of user tools that make life easier. ==== Setup ==== Emerging djbdns on Gentoo will automatically setup the user accounts (dnscache, dnslog, tinydns) for you. First, create a tinydns service: mkdir /var/djbdns tinydns-conf tinydns dnslog /var/djbdns/tinydns You can add a DNS local cache if you want, but it won't be used in this configuration. Create a symlink for the service, and start service scan: ln -s /var/djbdns/tinydns /service/tinydns /etc/init.d/svscan start === Initial DNS Setup === The documentation says that you will need to use ''./add-ns'' to claim in-addr.arpa names and serve reverse DNS names, but that is only necessary if you are in charge of an entire IP block. * [[http://cr.yp.to/djbdns/dot-arpa.html|How to receive a delegation from .in-addr.arpa]] ==== Usage ==== === Adding A Domain === == Nameserver records (NS) == Add a domain's NS records (a.ns.domain.com, b.ns.domain.com) cd /service/tinydns/root ./add-ns domain.com 209.177.158.152 ./add-ns domain.com 209.177.157.176 make == Host record (A) == Add the domain's first A record, also called the "host record". Note that this is only run once per IP address, so run it for the FQDN. cd /service/tinydns/root ./add-host domain.com make === DNS Scenarios === == Domain Alias (A Record) == cd /service/tinydns/root ./add-alias foo.domain.com make == Two Domains, One IP Address == Decide which hostname is going to be the FQDN and add the host record and aliases as normal: cd /service/tinydns/root ./add-host domain.com ./add-alias foo.domain.com make Any extra domain names will be an alias A record. There can only be one host record per IP address. cd /service/tinydns/root ./add-alias domain.com ./add-alias foo.domain.com make == Wildcard DNS (A Record) == cd /service/tinydns/root ./add-alias *.domain.com make == CNAME Record == You have to add it manually to the ''data'' file. The syntax is: Csub.domain.com:server.com.: Run ''make'' when finished.