Configure DNS
Configure DNS Organic Design procedure |
Dynamic DNS
It's often useful to be able to access machines on our local LAN's from other locations. Most of the LAN's we need to access machines on do not have static IP addresses, so a Dynamic DNS solution is used to keep a domain name up to date with the current IP address.
Our .com domain host is namecheap.com and they provide a free dynamic DNS solution allowing simple HTTP query-string based method of updating a sub-domain. We just add a single entry to /etc/crontab which looks like this (replace SUB, DOMAIN and PASS with your specific settings):
The subdomain will automatically be created when the first request is made if it didn't previously exist. The password is shown in the namecheap.com admin site in the "DynamicDNS" section for the appropriate domain.
Local DNS Server
Requests under the organisation's domain name from the Internet must be forwarded to the ISP-assigned external IP address using an A-record. This may require Dynamic DNS if a static IP address arrangement has not been made with the ISP.
Requests made for the domain from within the LAN require the local server to be authoritative, but to refer all other requests to the ISP-assigned DNS servers.
Install Bind9 with apt-get install bind9, then edit /etc/bind/named.conf.options and set the forwarders to your ISP's domain name server, e.g.
Then and the following zone configuration in /etc/bind/named.conf.local:
The zone files reside in /var/cache/bind and are of the following format:
And the reverse lookup file also in /var/cache/bind:
See also
- DynamicDNS.pl - the script we used to use to update DNS records only when router's external IP changes