134 dns name resolution version a.01 h3065s module 12 slides
TRANSCRIPT
1
DNS Name Resolution
Version A.01H3065S Module 12 Slides
2 © 1999 Hewlett-Packard Co.
H3065S A.01
Resolving Host Names to IP Addresses
a673123
BIND
Resolvinghost names to IP
addresses NIS/NIS+hosts Map/etc/hosts
3 © 1999 Hewlett-Packard Co.
H3065S A.01
DNS Overview
a673124
HierarchicalName Space
Components
of
DNS
ResolversNameServers
4 © 1999 Hewlett-Packard Co.
H3065S A.01
The DNS Hierarchical Name Space
a673125
.
govedu
domain host
" root "
com
cail ny
chicago
peoria
rockford
sanfran
oakland
la
nyc
albany
buffalo
Legend:
ibmacme hp
5 © 1999 Hewlett-Packard Co.
H3065S A.01
• Private name space is not connected to the public internet.• Organizations/companies can manage namespace as desired.
Public and Private Name Spaces
a69810
.
govedu com
cail ny
chicago
peoria
rockford
sanfran
oakland
la
nyc
albany
buffalo
ibmacme hp
.
com
gail ny
chicago
peoria
rockford
atlanta
athens
macon
nyc
albany
buffalo
hp
Public Name Space Private Name Space• Public Name space is connected to the public internet.• Organizations/companies are delegated responsibility for names/IPs within their domains.
6 © 1999 Hewlett-Packard Co.
H3065S A.01
in-addr.arpa Name Space
a69811
0
.
arpa
1281 254
in-addr
21 3
10 255
2551
sanfran oakland la
. . . . . .
. . . . . .
com
hp
ca
oakland lasanfran
128.1.1.1 128.1.1.2 128.1.1.3. . .. . .
sanfran.ca.hp.com = 1.1.1.128.in-addr.arpa.
7 © 1999 Hewlett-Packard Co.
H3065S A.01
Name Servers
a673128
ca.hp.com name server
sanfran.ca.hp.com 128.1.1.1oakland.ca.hp.com 128.1.1.2la.ca.hp.com 128.1.1.3
A DNS name server• resolves IP addresses to host names for clients• is delegated authority over a portion of the name space• can delegate authority to other name servers• should have a secondary name server as a backup
Example
8 © 1999 Hewlett-Packard Co.
H3065S A.01
Name Server Zones
a673129
. . . . . . . . .
hp
com .. .
corp ca az il ga wa ny tx nc
.hp.com Zone
hp.com domain
Delegated Subdomains
edu gov
.
9 © 1999 Hewlett-Packard Co.
H3065S A.01
Resolving Host Names in the Local Domain
a673130
oakland.ca.hp.com ca.hp.com NS
sanfran 128.1.1.1oakland 128.1.1.2la 128.1.1.3
# telnet la.ca.hp.com
la.ca.hp.com?
la = 128.1.1.3
10 © 1999 Hewlett-Packard Co.
H3065S A.01
Resolving Host Names in Other Domains
a69812
oakland# telnet atlanta.ga.hp.com
oakland ca.hp.com NS
. NS
com. NS
hp.com. NS
ga.hp.com. NS
atlanta.ga.hp.com?go to com. NS!
atlanta.ga.hp.com?
go to hp.com. NS!
atlanta.ga.hp.com?
go to ga.hp.com. NS!
atlanta.ga.hp.com?
atlanta = 128.1.3.1
atlanta.ga.hp.com?
128.1.3.1
11 © 1999 Hewlett-Packard Co.
H3065S A.01
Configuring a Primary Name Server
a673132
Notify the internic of your new subdomain.Fully qualify host names in /etc/hosts.Create a directory for the DNS database files.Create a parameter file for hosts_to_named.Create the DNS data and boot files with hosts_to_named.Download a db.cache file with pointers to the root servers.Modify /etc/rc.config.d/namesvrs and start the named daemon.Configure DNS client functionality on the primary server.
1.2.3.4.5.6.7.8.
12 © 1999 Hewlett-Packard Co.
H3065S A.01
Configuring a Secondary Name Server
a673133
Create a directory for the DNS data files.FTP a boot configuration file from the primary. FTP a copy of db.127.0.0 and db.cache from the primary.FTP additional DNS data files from the primary (optional).Modify /etc/rc.config.d/namesvrs and start named.Configure DNS client functionality on the secondary server.
1.2.3.4.5.6.
13 © 1999 Hewlett-Packard Co.
H3065S A.01
Configuring DNS Clients
a673134
1. Create /etc/resolv.confsearch ca.hp.com hp.comnameserver 128.1.1.1nameserver 128.1.1.2
2. Modify /etc/nsswitch.confhosts: dns nis files
3. Modify /etc/hosts127.0.0.1 localhost128.1.1.3 la.ca.hp.com la
4. Modify ~/.rhosts, /etc/hosts.equiv, and other files la user1
la.ca.hp.com. user1
14 © 1999 Hewlett-Packard Co.
H3065S A.01
Configuring the Name Service Switch
a673135
Q: Where should I look up host names? DNS? /etc/hosts? NIS?
hosts: files
hosts: dns nis files
hosts: files [NOTFOUND=continue] dns
hosts: files [NOTFOUND=continue] nis
A: Check /etc/nsswitch.conf!
ororor
15 © 1999 Hewlett-Packard Co.
H3065S A.01
Testing DNS with nslookup
a673136
Name Server: sanfran.ca.hp.comAddress: 128.1.1.1
Trying DNSName: oakland.ca.hp.comAddress: 128.1.1.2
# nslookup> server 128.1.1.1 # Choose a name server> oakland.ca.hp.com # Resolve a hostname to an IP> 128.1.1.2 # Resolve an IP to a hostname> exit
16 © 1999 Hewlett-Packard Co.
H3065S A.01
DNS Boot and Data Files
a673137
/etc/named.data
db.cache
db.ca
db.127.0.0
db.128.1.1
; Define the DNS data directory
directory /etc/named.data
; Define which domains this name server ; can serve, and which file contains the ; records for each of those domains. Note ; this name server is primary for all ; of the domains listed here.
primary ca.hp.com db.caprimary 1.1.128.in-addr.arpa db.128.1.1primary 0.0.127.in-addr.arpa db.127.0.0cache . db.cache
/etc/named.boot on the primary ca.hp.com name server:
17 © 1999 Hewlett-Packard Co.
H3065S A.01
Loading the DNS Data Files
a673138
System boot initiated
named starts at run level 2
named decides which db files to load
named loads db files in cache
Ready to resolve host names!
/etc/rc.config.d/namesvrs
/etc/named.boot
/etc/named.data/db.*
18 © 1999 Hewlett-Packard Co.
H3065S A.01
Updating the Primary Server
a673139
1. Update /etc/hosts on the primary.# vi /etc/hosts
2. Rebuild DNS data files with hosts_to_named.# cd /etc/named.data# hosts_to_named -f param
3. Reload DNS data files in cache with sig_named restart.# sig_named restart
19 © 1999 Hewlett-Packard Co.
H3065S A.01
Updating the Secondary Server
a673140
ca.hp.com. IN SOA sanfran.ca.hp.com root.sanfran.ca.hp.com (
3600 ; Retry every 1 hour
604800 ; Expire after 1 week
86400 ) ; Minimum TTL of 1 day
1 ; Serial10800 ; Refresh every 3 hours
Q: How do I know if my DNS data files are up to date? Q: When should I refresh my DNS data files?
Secondary Name Server named Daemon
A: named consults a data file’s SOA record to determines if/when the file must be updated: