If you can see this check that

next section prev section up prev page next page

DNS and Named


DNS named

User:
Password:

This tutorial in concerned with the setting up of your own DNS server using "named".

Question 1: RNDC key

The RNDC key is used to control your NAMED service. There is an RNDC key already built in your simulations. You can EITHER use that one or build your own.

To use the key already there (which is what I recommend) you need to copy the /etc/rndc.key file that contains the key into the NAMED chroot directory. The same key must be in both /etc/rndc.key and /var/named/chroot/etc/rndc.key. COPY the file, and do not just soft or hard link the file (it wont work).

If you REALLY insist on generating your own rndc key then proceed as follows... Due to a weakness in the VM simulations the random function which helps generate keys is slightly broken (not usually enough entropy). You will likely have to use the keyboard to generate the random key.

Type the command:

  rndc-confgen -a -b 128 -t /var/named/chroot -r keyboard

If it works, you will get a message saying "start typing" and then after a while "stop typing". Type randomly when requested.

Tests - not attempted
Secret in /etc/rndc.key UNTESTED
Secret in /var/named/chroot/etc/rndc.key UNTESTED
Secrets are identical UNTESTED

Question 2: Configuration

To allow NAMED to see its configuration file, it too must be copied into the chroot directory. COPY /etc/named.conf into /var/named/chroot/etc/.

Tests - not attempted
Check that /var/named/chroot/etc/named.conf seems sensible UNTESTED

Question 3: See it working

Start up the NAMED service and check that it works. To start NAMED run "/etc/init.d/named start". You may have to run this twice the first time (wierd). You have to reload or restart this service when you make a configuration change remember. The easiest way to check that the service and config files work is:

dig localhost @localhost

If it responds then your server is up. It should indicate that the SERVER was 127.0.0.1 and that localhost an A record of 127.0.0.1.

Tests - not attempted
Service Running UNTESTED

Question 4: Basic Forward Resolving

Edit the /var/named/chroot/var/named/localhost.zone file so that the host "stupid.localhost" in the domain "localhost" resolves to an A address of 127.0.0.5. Do not delete the 127.0.0.1 entry currently stored in this file. In fact, DO NOT DELETE ANYTHING. You are only ADDING 1 additional line to the end of this file!

Note that there is no sensible reason for ever doing this, but you have to learn things somehow! After the edit remember to single NAMED to reload (you can use reload or restart on the service control file in init.d, or a variety of other techniques you may already know).

Tests - not attempted
Add A for stupid.localhost UNTESTED
Check stupid.localhost resolves UNTESTED

Question 5: Basic reverse resolving

Edit the reverse resolve file for the 127.0.0 IP range so that 127.0.0.5 has a PTR back to stupid.localhost. In the default case this file is named.local. Once again, this needs you to add 1 additional line to this file, not to delete or edit any existing lines.

Tests - not attempted
Add PTR for stupid.localhost UNTESTED
Check reverse resolves UNTESTED

Question 6: New Zone

Create a brand new forward zone for domain "sillynet.net". For this you should create a new zone file called "sillynet.zone" (copying localhost.zone to sillynet.zone might be a good starting point). Add this file, along with its zone information, to the configuration file /var/named/chroot/etc/named.conf.

This zone should give:

sillynet.net -> IP address 127.0.0.20
www.sillynet.net -> IP address 127.0.0.30

Tests - not attempted
sillynet.zone has A record for .20 UNTESTED
sillynet.zone has A record for .30 UNTESTED
sillynet.zone has ZONE record in named.conf UNTESTED
Check sillynet.net resolves UNTESTED
Check www.sillynet.net resolves UNTESTED

Question 7: Advanced Zone

Create a brand new forward zone for domain "advanced.com". For this create a new forward zone file "advanced.zone" (copy localhost.zone as a starting point), and a new reverse zone file "advanced.rev" (copy "named.local" as a starting point). Add both forward and reverse zones, along with the zone information, to the configuration file /var/named/chroot/etc/named.conf. The zone will use the 172.16.1.0/24 network, so in the named.conf file the reverse zone will be "1.16.172.in-addr.arpa".

This zone should give:

advanced.com     -> IP address 172.16.1.1
                 -> MX record mail.advanced.com, priority 10
                 -> MX record mail.offsite.com, priority 20
www.advanced.com -> IP address 172.16.1.10,
                               172.16.1.11,
                               172.16.1.12 using a round-robin selection.
172.16.1.1 -> advanced.com
172.16.1.10 -> www.advanced.com
172.16.1.11 -> www.advanced.com
172.16.1.12 -> www.advanced.com

Tests - not attempted
forward zone record in named.conf UNTESTED
reverse zone record in named.conf UNTESTED
forward zone file has A record for advanced.com UNTESTED
forward zone file mentions .10, .11, and .12 UNTESTED
reverse zone file mentions .1, .10, .11, and .12 UNTESTED
MX records in file are present UNTESTED
Check advanced.com resolves UNTESTED
Check www.advanced.com has all A records UNTESTED
Check reverse advanced.com resolves UNTESTED
Check reverse www.advanced.com resolves UNTESTED
Check MX for advanced.com UNTESTED


Tutlinks: intro1 intro2 wildcard permission pipe vi essential admin net fwall DNS diag Apache1 Apache2 MySQL1 MySQL2
Useful: Quiz Forums
Site Links:XMLZoo ActiveSQL ProgZoo SQLZoo