Table of Content

109.4 Configure client side DNS

Weight: 2

Description: Candidates should be able to configure DNS on a client host.

Key Knowledge Areas:

  • Query remote DNS servers
  • Configure local name resolution and use remote DNS servers
  • Modify the order in which name resolution is done

Terms and Utilities:

/etc/hosts
/etc/resolv.conf
/etc/nsswitch.conf
host
dig
getent

DNS lookup

nslookup
- interactive
- deprecated

host
- replaces nslookup
- no interactive

dig
more complex DNS lookups than host

oldhorse@dclab:~$ nslookup google.ca
Server: 192.168.100.2
Address: 192.168.100.2#53

Non-authoritative answer:
Name: google.ca
Address: 172.217.1.67

oldhorse@dclab:~$ host google.ca
google.ca has address 172.217.1.67
google.ca has IPv6 address 2607:f8b0:4006:808::2003
google.ca mail is handled by 30 alt2.aspmx.l.google.com.
google.ca mail is handled by 10 aspmx.l.google.com.
google.ca mail is handled by 40 alt3.aspmx.l.google.com.
google.ca mail is handled by 50 alt4.aspmx.l.google.com.
google.ca mail is handled by 20 alt1.aspmx.l.google.com.

oldhorse@dclab:~$ dig www.google.com +noadflag

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; MBZ: 0005 , udp: 4096
;; QUESTION SECTION:
;www.google.com. IN A

;; ANSWER SECTION:
www.google.com. 5 IN A 74.125.21.104
www.google.com. 5 IN A 74.125.21.106
www.google.com. 5 IN A 74.125.21.99
www.google.com. 5 IN A 74.125.21.147
www.google.com. 5 IN A 74.125.21.103
www.google.com. 5 IN A 74.125.21.105

;; AUTHORITY SECTION:
google.com. 5 IN NS ns2.google.com.
google.com. 5 IN NS ns1.google.com.
google.com. 5 IN NS ns3.google.com.
google.com. 5 IN NS ns4.google.com.

;; ADDITIONAL SECTION:
ns2.google.com. 5 IN A 216.239.34.10
ns1.google.com. 5 IN A 216.239.32.10
ns3.google.com. 5 IN A 216.239.36.10
ns4.google.com. 5 IN A 216.239.38.10

;; Query time: 109 msec
;; SERVER: 192.168.100.2#53(192.168.100.2)
;; WHEN: Thu Mar 10 06:36:59 EST 2016
;; MSG SIZE rcvd: 275

getent

getent database key

database can be one of the following files:
passwd (the /etc/passwd file)
shadow (the /etc/shadow file)
group (the /etc/group file)

#getent passwd oldhorse
#getent shadow oldhorse
#getent group oldhorse

/etc/nsswitch.conf

Name Service Switch (NSS) service

hosts: files dns
networks: files

/etc/resolv.conf

DNS server

oldhorse@dclab:~$ cat /etc/resolv.conf
nameserver 192.168.100.2
search localdomain