Version A.01 H3065S Module 12 Slides DNS Name Resolution Version A.01 H3065S Module 12 Slides
Resolving Host Names to IP Addresses 4/21/2017 Resolving Host Names to IP Addresses BIND Resolving host names to IP addresses NIS/NIS+ /etc/hosts hosts Map a673123
DNS Overview Hierarchical Name Space Components of DNS Name Resolvers 4/21/2017 DNS Overview Hierarchical Name Space Components of DNS Name Resolvers Servers a673124
The DNS Hierarchical Name Space 4/21/2017 The DNS Hierarchical Name Space . " root " edu gov com acme hp ibm il ca ny chicago sanfran nyc peoria oakland albany rockford la buffalo Legend: domain host a673125
Public and Private Name Spaces 4/21/2017 Public and Private Name Spaces . . com edu com gov hp acme hp ibm il ga ny il ca ny chicago atlanta nyc chicago sanfran nyc peoria athens albany peoria oakland albany rockford macon buffalo rockford la buffalo 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. Private name space is not connected to the public internet. Organizations/companies can manage namespace as desired. a69810
in-addr.arpa Name Space 4/21/2017 in-addr.arpa Name Space . arpa com in-addr hp . . . 1 128 . . . 254 ca . . . . . . 1 255 sanfran oakland la . . . 128.1.1.1 128.1.1.2 128.1.1.3 1 . . . 255 1 2 3 sanfran oakland la sanfran.ca.hp.com = 1.1.1.128.in-addr.arpa. a69811
Name Servers A DNS name server 4/21/2017 Name Servers 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 ca.hp.com name server sanfran.ca.hp.com 128.1.1.1 oakland.ca.hp.com 128.1.1.2 la.ca.hp.com 128.1.1.3 a673128
. . . . . . . . . . . . . . Name Server Zones hp.com Zone 4/21/2017 Name Server Zones . . . . com edu gov hp.com Zone . hp . . . . . . . . . corp ca az il ga wa ny tx nc Delegated Subdomains hp.com domain a673129
Resolving Host Names in the Local Domain 4/21/2017 Resolving Host Names in the Local Domain ca.hp.com NS la.ca.hp.com? la = 128.1.1.3 oakland.ca.hp.com # telnet la.ca.hp.com sanfran 128.1.1.1 oakland 128.1.1.2 la 128.1.1.3 a673130
Resolving Host Names in Other Domains 4/21/2017 Resolving Host Names in Other Domains atlanta.ga.hp.com? go to com. NS! . NS atlanta.ga.hp.com? com. NS oakland ca.hp.com NS go to hp.com. NS! atlanta.ga.hp.com? 128.1.3.1 atlanta.ga.hp.com? hp.com. NS go to ga.hp.com. NS! atlanta.ga.hp.com? atlanta = 128.1.3.1 oakland# telnet atlanta.ga.hp.com ga.hp.com. NS a69812
Configuring a Primary Name Server 4/21/2017 Configuring a Primary Name Server 1. 2. 3. 4. 5. 6. 7. 8. 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. a673132
Configuring a Secondary Name Server 4/21/2017 Configuring a Secondary Name Server 1. 2. 3. 4. 5. 6. 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. a673133
Configuring DNS Clients 4/21/2017 Configuring DNS Clients 1. Create /etc/resolv.conf search ca.hp.com hp.com nameserver 128.1.1.1 nameserver 128.1.1.2 2. Modify /etc/nsswitch.conf hosts: dns nis files 3. Modify /etc/hosts 127.0.0.1 localhost 128.1.1.3 la.ca.hp.com la 4. Modify ~/.rhosts, /etc/hosts.equiv, and other files la user1 la.ca.hp.com. user1 a673134
Configuring the Name Service Switch 4/21/2017 Configuring the Name Service Switch Q: Where should I look up host names? DNS? /etc/hosts? NIS? A: Check /etc/nsswitch.conf! hosts: files hosts: dns nis files hosts: files [NOTFOUND=continue] dns hosts: files [NOTFOUND=continue] nis or or or a673135
Testing DNS with nslookup 4/21/2017 Testing DNS with nslookup # 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 Name Server: sanfran.ca.hp.com Address: 128.1.1.1 Trying DNS Name: oakland.ca.hp.com Address: 128.1.1.2 a673136
4/21/2017 DNS Boot and Data Files /etc/named.data /etc/named.boot on the primary ca.hp.com name server: ; 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.ca primary 1.1.128.in-addr.arpa db.128.1.1 primary 0.0.127.in-addr.arpa db.127.0.0 cache . db.cache db.ca db.127.0.0 db.128.1.1 db.cache a673137
Loading the DNS Data Files 4/21/2017 Loading the DNS Data Files Ready to resolve host names! named loads db files in cache /etc/named.data/db.* named decides which db files to load /etc/named.boot named starts at run level 2 /etc/rc.config.d/namesvrs System boot initiated a673138
Updating the Primary Server 4/21/2017 Updating the Primary Server 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 a673139
Updating the Secondary Server 4/21/2017 Updating the Secondary Server 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: 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 ; Serial 10800 ; Refresh every 3 hours a673140