Sample Reverse Zone File
Now you need to make sure that you can do a host query on all your home network's PCs and get their correct IP addresses. This is very important if you are running a mail server on your network, because sendmail typically relays mail only from hosts whose IP addresses resolve correctly in DNS. NFS, which is used in network-based file access, also requires valid reverse lookup capabilities.
This is an example of a zone file for the 192.168.1.x network. All the entries in the first column refer to the last octet of the IP address for the network, so the IP address 192.168.1.100 points to the name bigboy.my-site.com.
Notice how the main difference between forward and reverse zone files is that the reverse zone file only has PTR and NS records. Also the PTR records cannot have CNAME aliases.
;; Filename: 192-168-1.zone;; Zone file for 192.168.1.x;$TTL 3D200303301 ; serial number8H ; refresh, seconds2H ; retry, seconds4W ; expire, seconds1D ) ; minimum, seconds
NS www ; Nameserver Address
100 PTR bigboy.my-site.com.103 PTR smallfry.my-site.com.102 PTR ochorios.my-site.com.105 PTR reggae.my-site.com.
32 PTR dhcp-192-168-1-32.my-site.com.33 PTR dhcp-192-168-1-33.my-site.com.34 PTR dhcp-192-168-1-34.my-site.com.35 PTR dhcp-192-168-1-35.my-site.com.36 PTR dhcp-192-168-1-36.my-site.com.
I included entries for addresses 192.168.1.32 to 192.168.1.36, which are the addresses the DHCP server issues. SMTP mail relay wouldn't work for PCs that get their IP addresses via DHCP if these lines weren't included.
You may also want to create a reverse zone file for the public NAT IP addresses for your home network. Unfortunately, ISPs won't usually delegate this ability for anyone with less than a Class C block of 256 IP addresses. Most home DSL sites wouldn't qualify.
Loading Your New Configuration Files
Make sure your configuration files are in the correct locations and the serial numbers of the zone files you may have modified have been updated. If all seems correct, restart BIND named daemon for the configuration to become active.
[root@bigboy tmp]# /etc/init.d/named restart
Take a look at the end of your /var/log/messages file to make sure there are no errors.
Make Sure Your /etc/hosts File Is Correctly Updated
Chapter 3, "Linux Networking", explains how to correctly configure your /etc/hosts file. Some programs, such as sendmail, require a correctly configured /etc/hosts file even though DNS is correctly configured.
Configure Your Firewall
The sample network assumes that the BIND name server and Apache Web server software run on the same machine protected by a router/firewall. The actual IP address of the server is 192.168.1.100, which is a private IP address. You'll have to use NAT for Internet users to be able to gain access to the server via the chosen public IP address, namely 188.8.131.52. If your firewall is a Linux box, you may want to consider taking a look at Chapter 14, "Linux Firewalls Using iptables", describes how to do the network address translation and allow DNS traffic through to your name server.
Fix Your Domain Registration
Remember to edit your domain registration for my-site.com, or whatever it is, so that at least one of the name servers is your new name server (184.108.40.206 in this case). Domain registrars, such as VeriSign and RegisterFree, usually provide a Web interface to help you manage your domain.
Once you've logged in with the registrar's username and password, you'll have take two steps:
- 1) Create a new name server record entry for the IP address 220.127.116.11 to map to ns.my-site.com or www.my-site.com or whatever your name server is called. (This screen prompts you for both the server's IP address and name.)
- 2) Assign ns.my-site.com to handle your domain. This screen will prompt you for the server name only.
- Sometimes, the registrar requires at least two registered name servers per domain. If you only have one, then you could either create a second name server record entry with the same IP address, but different name, or you could give your Web server a second IP address using an IP alias, create a second NAT entry on your firewall and then create the second name server record entry with the new IP address, and different name.
It normally takes about three to four days for your updated DNS information to be propagated to all 13 of the world's root name servers. You'll therefore have to wait about this amount of time before starting to notice people hitting your new Web site.
You can use the chapter's troubleshooting section to test specific DNS servers for the information they have on your site. You'll most likely want to test your new DNS server, which should be up to date, plus a few well known ones, which should have delayed values.