Ubuntu Unleashed 2019 Edition: Covering 18.04, 18.10, 19.04

(singke) #1

Microsystems to specify the order in which services are accessed on the
system. A number of services are listed in the /etc/nsswitch.conf file,
but the most commonly modified entry is the hosts entry. A portion of the


file may look like this:


Click here to view code image
passwd: compat
group: compat
shadow: compat


hosts:                                      files   dns mdns
networks: files

protocols:                      db  files
services: db files
ethers: db files
rpc: db files

netgroup:                           nis

This tells services that they should consult standard UNIX/Linux files for
passwd, shadow, and group (/etc/passwd, /etc/shadow,
/etc/group, respectively) lookups. For host lookups, the system checks
/etc/hosts; if there is no entry, it checks DNS. The commented hosts
entry lists the possible values for hosts. Edit this file only if your naming
service has changed.


Setting a Name Server with /etc/resolv.conf

/etc/resolv.conf is used by DNS. The following is an example of
resolv.conf:


Click here to view code image
nameserver 192.172.3.8
nameserver 192.172.3.9
search mydomain.com


This sets the nameservers and the order of domains for DNS to use. The
contents of this file are set automatically if you use DHCP (see the “Dynamic
Host Configuration Protocol” section, later in this chapter).


Starting with 12.04, there was a pretty big change in how Ubuntu uses the
/etc/resolv.conf file. Management of resolv.conf has been
turned over to a program called resolvconf, which works with DHCP,
with a Network Manager plug-in, and with /etc/network/interfaces
to automatically generate a list of nameservers and domains to list in

Free download pdf