Professional Documents
Culture Documents
Activity
Configure basic DNS server in Linux using CLI
Blacktown College
Information Technology
Document Information
Document Owner: WSI1445 File Location:
/home/sking1/Desktop/2009
1/02_Classess/01_NetDev/Weeks_02
09/Activities/Week_05/051_ActivityDNS.odt
Created: 11. Mar. 2008 @ 16:37 Modified: 12. Mar. 2009
Author: Stephen King Page Count: 12
Version: 1.12
Table of Contents
Document Information..............................................................................................2
Objective...............................................................................................................................................5
Pre-requisit...........................................................................................................................................5
Resources..............................................................................................................................................5
VM Information....................................................................................................................................6
Virtual Machine Settings.................................................................................................................6
Interface Configuration....................................................................................................................6
User Configuration..........................................................................................................................6
Services Configuration....................................................................................................................6
Activity Start........................................................................................................................................7
Step 1 – Creating zone files.............................................................................................................7
Step 2 – Creating zone lookup files.................................................................................................8
Step 3 – Checking the Resolver.....................................................................................................10
Step 4– Testing..............................................................................................................................10
Lets add a new resource record......................................................................................................11
Self-Paced...........................................................................................................................................12
Blacktown College Information Technology
NetDev Activity
Objective
To configure a basic DNS service using command line tools
Pre-requisit
You should have a basic knowledge of DNS
Resources
You will need the following:
● Copy of SLES10Base Virtual Machine, Provided on DVD
Note: When starting your virtual machine you may get a dialog box asking you about
the ID, please select the Keep option.
Students will log in using normal user and switch user to root when required.
© Stephen King (WSITBlacktown College). Verbatim copying and distribution of 5 of 12
this entire article is permitted in any medium.
Blacktown College Information Technology
NetDev - Activity
VM Information
The virtual machine for this exercise has the following configuration:
Interface Configuration
IP Address: 172.18.255.254
Netmask: 255.255.0.0
Host Name: svr1
Domain Name: sample.com
Name Server: 172.18.255.254
Default Gateway: 172.18.0.2
User Configuration
Two users have been created:
Username Password
root secret
student password
Services Configuration
<What services have been configured> Nil
© Stephen King (WSITBlacktown College). Verbatim copying and 6 of 12
distribution of this entire article is permitted in any medium.
Blacktown College - Information Technology
Configure basic DNS in Linux using CLI
Activity Start
Change the current NIC configuration to:
IP Address = 192.168.0.254
Subnet Mask = 255.255.255.0
You change this by editing the file (with joe):
/etc/sysconfig/network/ifcfgethid00:0c:29:c7:b0:dc
reload the network configuration using the following command:
rcnetwork reload
Now we can begin:
7 of 12 05-1_Activity-DNS
Blacktown College Information Technology
NetDev - Activity
Item/Description Command
Navigate to /var/lib/named cd /var/lib/named
IN NS @
IN A 127.0.0.1
We will now modify this file to $TTL 1W
suite our requirements. The @ IN SOA svr1.sample.com. root.sample.com.(
Bolded sections are the changes 42 ; serial (d. adams)
to be made. 2D ; refresh
4H ; retry
6W ; expiry
1W ) ; minimum
IN NS svr1.sample.com.
© Stephen King (WSITBlacktown College). Verbatim copying and 8 of 12
distribution of this entire article is permitted in any medium.
Blacktown College - Information Technology
Configure basic DNS in Linux using CLI
Item/Description Command
Save this file as sample.db CTRL + K +D
(Press enter to accept the file name that you have provided.)
With the file still open, modify $TTL 1W
it for our reverse zone lookup @ IN SOA svr1.sample.com. root.sample.com.(
file 42 ; serial (d. adams)
2D ; refresh
4H ; retry
6W ; expiry
1W ) ; minimum
IN NS svr1.sample.com.
Save the file as 0.168.192.db CTRL + K +D
Enter the filename 0.168.192.db
Press enter to accept the value you have entered.
Now close the file using CTRL CTRL + C
+C. We do not want to save this No, we do not want to save this file
file as doing so will overwrite a
previous file
9 of 12 05-1_Activity-DNS
Blacktown College Information Technology
NetDev - Activity
Step 4– Testing
Item/Description Command
Check to see if the named rcnamed status
service is running:
If it is stopped you will need to rcnamed start
start it
We will use the nslookup nslookup 192.168.0.254
command to ensure our DNS
server is working
Then we will check the forward nslookup svr1.sample.com
lookup
If your lookup does not return
the correct result, check your
configuration files and make any
changes required.
After making changes you will rcnamed reload
need to reload the configuration
files. This is done using the
following command:
© Stephen King (WSITBlacktown College). Verbatim copying and 10 of 12
distribution of this entire article is permitted in any medium.
Blacktown College - Information Technology
Configure basic DNS in Linux using CLI
Item/Description Command
open joe /var/lib/named/master/sample.db
/var/lib/named/master/sample.db
Add the bolded line to the end of the $TTL 1W
file @ IN SOA svr1.sample.com. root.sample.com.(
42 ; serial (d. adams)
2D ; refresh
4H ; retry
6W ; expiry
1W ) ; minimum
IN NS svr1.sample.com.
svr1 IN A 192.168.0.254
www CNAME svr1
Use CTRL + K + X to save and exit ctrl + X
END OF ACTIVITY
11 of 12 05-1_Activity-DNS
Blacktown College Information Technology
NetDev - Activity
Self-Paced
Now that you have setup DNS within the context given, try to make changes such as:
● Change NIC settings using different subnets
● Redo DNS (named.conf etc) for these new settings
● Add extra zones:
○ techsupport.sample.com
○ catalog.sample.com
© Stephen King (WSITBlacktown College). Verbatim copying and 12 of 12
distribution of this entire article is permitted in any medium.