omnisecu.com free mcse ccna rhce linux java learning  
Home Knowldege Base FAQ Contact Us Sitemap
omnisecu.com free mcse ccna rhce linux java learning  
omnisecu.com free mcse ccna rhce linux java learning
Home » Knowledge Base » Linux » RedHat Certified Engineer (RHCE) » Linux Domain Name System (DNS) client configuration files /etc/hosts, /etc/nsswitch.conf and /etc/resolv.conf
 

Linux Domain Name System (DNS) client configuration files /etc/hosts, /etc/nsswitch.conf and /etc/resolv.conf

 

There are three main client configuration files associated with DNS: /etc/hosts, /etc/nsswitch.conf and /etc/resolv.conf. When your computer looks for another computer on a TCP/IP network such as the Internet, it typically looks in two places: /etc/hosts and any DNS servers that you've set up for your network.

/etc/hosts

The /etc/hosts file keeps a local name database. This file helps in local name resolution if your local DNS server is not functioning. Network adinistrators should manually populate entries in this file. A sample /etc/hosts file is copied below.

[root@RHEL01 ~]# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
192.168.1.1 RHEl01.omnisecu.com RHEL01
192.168.1.105 RHEL05.omnisecu.com RHEL05
192.168.1.106 RHEL06.omnisecu.com RHEL06
192.168.1.107 RHEL07.omnisecu.com RHEL07
192.168.1.108 RHEL08.omnisecu.com RHEL08
192.168.1.109 RHEL09.omnisecu.com RHEL09

/etc/nsswitch.conf

The order of name resolution process is determined by a single line in /etc/nsswitch.conf:

hosts: files,dns

In this case, the name resolution process will begin with checking /etc/hosts file, and if the name cannot be resolved, the name resolution will happen with the DNS server.

/etc/resolv.conf

The /etc/resolv.conf file contains directives with the IP addresses of nameservers available to a host. A sample /etc/resolv.conf file is copied below.

[root@RHEL01 ~]# cat /etc/resolv.conf
search omnisecu.com
nameserver 192.168.1.1


 

Related Topics...

Common Linux network tools - ping, telnet, netstat and arp

Linux xinetd Super Server daemon

Linux Network Interface Configuration tool - ifconfig

Important Linux network configuration files

How to configure Dynamic Host Configuration Protocol (DHCP) in Linux

Introduction to Domain Name System (DNS)

Berkeley Internet Name Domain (BIND) as a DNS server

How to configure caching-only name server

BIND configuration file (/etc/named.conf)

Domain Name System (DNS) zone files

RNDC (Remote Name Daemon Control)

 


eXTReMe Tracker

back
next
 
Disclaimer | Feed Back | Trademarks | Knowledge Base | FAQ | Sitemap | Downloads