AIX 5L Configuring TCP/IP (Unit 08 – Part 1) – Domain Name System (DNS)

Unit Objectives
Describe domain name concepts and terminology
List the types of name servers
Configure a name server and a client
Identify files used with DNS
Use the nslookup command to query domain name servers

Name Resolution
Internet Address <---Name Resolution---> Hostname

Flat Network – Use /etc/hosts
Domain Name – Use Name Server
NIS Environment – Use NIS Server
LDAP Environment – Use LDAP Server

Review Flat Network
/etc/hosts sys1 sys2…
Problem: As network grows so does the /etc/hosts file. One person has to manage a master copy of the /etc/hosts file and then distribute it to all of the other machines.
Therefore, there was a need for a better way to handle name resolution.

Domain Name Space Concept
Delegates responsibility for name resolution to Zones of Authority each with its own Name Server.

Note: You do not have to have a correlation between the network you belong to and the Name server.

Domain Name System
Created due to growth of the Internet
Designed for large networks
– Standard resource records (Server)
– Resolver routines (Client) – What name server to access to resolve names.
– A standard backup system for a name server

Primary Server
Secondary Server (Backup of Primary Server)
Cache Server (Balance the load)

Internet Domain Name Structure
Top-Level Domains (Central Administration)
Sub-Level Domains (Local Administration)

mil (militray)
com – commercial (Sub-Level Domain – ex. ibm –> cd, vnet, austin)
edu – educational (Sub-Level Domain – ex. ucb, mit)
arpa – in-addr

Every machine as a default domain name. The system automatically appends the default domain name to your system name.

Note: If you append a dot . to the end of the full name then it will not try appending other domain names to the end. (Ex.

Types of Name Servers
Primary Name Server
Secondary Name Server
Caching-only Name Server
Forwarder Name Server

Domain or Flat Network?
/etc/resolv.conf exist? (Contains the IP Address of the Domain Server)
No – Flat Network (Use /etc/hosts file)
Yes – Domain Network

Default Name Resolution Hierarchy
1. Is DNS running? Yes – Check nameserver for resolution. Found (Resolved)
2. Is NIS running? Yes – Check NIS server for resolution. Found (Resolved) No (Failed)
3. /etc/hosts

Overriding the Default Name Resolution Hierarchy
Create /etc/netsvc.conf
– Options include “bind, ldap, nis, local”
– Example host=bind,local

Note: bind means dns, local refers to /etc/hosts

Set NSORDER evnironment variable
– NSORDER=nis=auth,bind,local
Note: nis is authoritative, only if you can not get to nis will it go to the name server and local.

Planning a Domain Network
Determine systems in domain
Determine domain name
Choose primary name server
Choose secondary name servers
Remaining systems will be clients

Note: It is recommended that the Primary and Secondary domain servers be on separate networks so that if one network goes down the second can still operate.

Setting Up the Primary Name Server
Create “named” control file (identifies all of the other files below)
Create name zone file (translate a Host name to an IP Address)
Create IP zone files (translate an IP Address to a Host name)
Create local IP zone file (translate for local loopback)
Create cache file (how to find the higher level of authority)
Create /etc/resolv.conf (name server is a client and points back to itself for resolution)
Start “named” daemon
– BIND4 uses /etc/named.boot
– BIND8 uses /etc/named.config

Primary “named” Control File
# pg /etc/named.boot

Type Domain Filename
———— —————————– —————————————-
directory /etc (where the zone files are located)
primary named.dc (name zone file)
primary named.revip98 (IP zone file)
primary named.revip99 (IP zone file)
primary named.local (local IP zone file)
cache . (cache file)

Note: Since the /etc directory is crowded, you may want to put these files in another subdirectory /etc/dns.

Scripts to Build Zone Files
IBM provides awk scripts
– /usr/samples/tcpip/hosts.awk (name zone)
– /usr/samples/tcpip/addrs.awk (reverse IP zone)

Run on /etc/hosts file
Produce name and IP zone files
Use to create initial zone files

Note: If you have IP addresses in the /etc/hosts file for multiple subnets then the script will put them all in the same zone file. You will need a separate zone file for each subnet. Therefore, run the addrs.awk script once for each subnet you have and then delete out those IP addresses that don’t belong to that subnet.

Once the zone files are created, any additions or changes should be made to the zone files and not to the /etc/hosts file.

Name Zone File
# pg /etc/named.dc
; name server data file
; also see /etc/named.boot
; setting default domain to “”
1.1 ; Serial
3600 ; Refresh
300 ; Retry
3600000 ; Expire
86400 ) ; Minimum TTL

IN NS sys1
IN NS sys6
sys1 IN A
sys2 IN A

localhost IN A
loopback IN CNAME localhost

SOA – Start of Authority
NS – Name Server Resource Records
A – Address Resource Records
CNAME – Alias

Note: Make sure that you update the Serial number. Otherwise, the Secondary Servers will not know that they are out of sync with the Primary Server.

Refresh – How often should the Secondary Server check for changes in seconds.
Retry – How often should the Secondary Server try to connect to the Primary if it can’t get to it.
Expire – How long the secondary information is good for until stops acting as a name server.
Minimum TTL – How long do you keep it in cache before removing it.

IP Zone File
# pg /etc/named.revip98

@ is substituted for
Note: Closely matches previous.

Local IP Zone File
# pg /etc/named.local

1 IN PTR localhost. (make sure to end with the period)

Note: the @ maps back to in the Name Zone File.

Cache File
# pg /etc/

. 9999999 IN NS 9999999 IN A

Final Primary Name Server Setup Steps
1. Change the host name to the fully qualified domain name
– # smit hostname
2. Create /etc/resolv.conf
3. # vi /etc/rc.tcpip
– Uncomment line to start named
4. # startsrc -s named

Primary Name Server Files
/etc/named.boot (main configuration file with names of all other files)
/etc/named.revip99 (reverse IP name resolution file)
/etc/named.revip98 (reverse IP name resolution file)
/etc/named.dc (forward IP name resolution file)
/etc/ (cache file – where do I go if there is no local cache file)
/etc/resolv.conf (to be able to act as a client also)
/etc/named.local (local loopback file)

Leave a Reply

Your email address will not be published. Required fields are marked *