Name Resolution in UNIX

Posted on 2003-02-20
Medium Priority
Last Modified: 2013-12-06
Can anybody tell me the name resolution mechanism in UNIX servers ??

In Windows 2000 it is DNS resolution first and then WINS resolution. What is the order in UNIX ?

Question by:sam74
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 48

Expert Comment

ID: 7989979
Depends on the flavour of Unix, but you may have /etc/nsswitch.conf

LVL 18

Expert Comment

ID: 7992404
Look at the hosts line in /etc/nsswitch.conf, it may be something like:
hosts: files nis dns

This would lokk at the local host file (/etc/hosts) first, then query you NIS server, then query the nameservers (DNS) that are specified in /etc/resolv.conf
LVL 46

Accepted Solution

Kent Olsen earned 80 total points
ID: 7993254

Both posters are correct.

Older unix systems relied on the /etc/hosts file for name/address resolution.  As the DNS/Bind technology took hold, the "default" behavior was to search /etc/hosts, then query the DNS.

Most modern unix systems now allow the admin to select the search order.  The controlling file name changes depending up the unix/linux distribution.  /etc/nsswitch.conf is used in Linux environments, /etc/netsvc.conf is used by AIX, still another name (that I don't remember) is used by HP-UX.  I don't know what Solaris, et al, name their control file.

ls /etc/*.conf will list your "configuration" files which you can examine for a "hosts=" statement.  You can probably grep the list, but the statement is "free form" so it might take several attempts.

grep "hosts=" /etc/*.conf
grep "hosts =" /etc/*.conf

If your your system doesn't contain a control switch you can expect it to check the /etc/hosts file first.


Expert Comment

ID: 8109089
On a linux system your /etc/host.conf file contains:

order hosts,bind

which means it will look for a hosts file, then query DNS. This will be similar on FreeBSD.


Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.
Suggested Courses
Course of the Month11 days, 18 hours left to enroll

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question