Page 98 - DCAP602_NETWORK_OPERATING_SYSTEMS_I
P. 98
Network Operating Systems-I
notes /etc/nsswitch.conf List order of host name search. Typically look at local
files, then NIS server, then DNS server.
Manual page for: /etc/nsswitch.conf
Red Hat/Fedora/CentOS: /etc/sysconfig/ Specify network configuration. eg. Static IP, DHCP,
network NIS, etc.
Red Hat/Fedora/CentOS: /etc/sysconfig/ Specify TCP network information.
network-scripts/ifcfg-device
Ubuntu/Debian: /etc/network/interfaces Specify network configuration and devices. eg. Static
IP and info, DHCP, etc.
Domain Resolution Configuration Files
1. File: /etc/resolv.conf - host name resolver configuration file
search name-of-domain.com - Name of your domain or ISP’s domain if
using their name server
nameserver XXX.XXX.XXX.XXX - IP address of primary name server
nameserver XXX.XXX.XXX.XXX - IP address of secondary name server
This configures Linux so that it knows which DNS server will be resolving domain names
into IP addresses. If using DHCP client, this will automatically be sent to you by the ISP
and loaded into this file as part of the DHCP protocol. If using a static IP address, ask the
ISP or check another machine on your network. Red Hat/Fedora GUI: /usr/sbin/system-
config-network (select tab “DNS”).
2. File: /etc/hosts: locally resolve node names to IP addresses
127.0.0.1 your-node-name.your-domain.com localhost.localdomain
localhost
XXX.XXX.XXX.XXX node-name
Note when adding hosts to this file, place the fully qualified name first. (It helps sendmail
identify your server correctly) i.e.:
XXX.XXX.XXX.XXX superserver.yolinux.com superserver
This informs Linux of local systems on the network which are not handled by the DNS
server. (or for all systems in your LAN if you are not using DNS or NIS)
The file format for the hosts file is specified by RFC 952.
3. Red Hat/Fedora configuration GUI: /usr/sbin/system-config-network (select tab
“Hosts”).
4. File: /etc/nsswitch.conf: System Databases and Name Service Switch configuration file
hosts: files dns nisplus nis
This example tells Linux to first resolve a host name by looking at the local hosts file(/etc/
hosts), then if the name is not found look to your DNS server as defined by /etc/resolv.
conf and if not found there look to your NIS server.
Note In the past this file has had the following names: /etc/nsswitch.conf, /etc/svc.
conf, /etc/netsvc.conf, ... depending on the distribution.
92 LoveLy professionaL university