Solved

RHEL Name Resolution Local Host file and DNS

Posted on 2013-01-02
4
943 Views
Last Modified: 2013-01-02
Unable to get name resolution from RHEL 5 /etc/hosts.

/etc/nsswitch.conf includes:

hosts: files dns

Example: /etc/hosts contains:
172.113.100.1       testsservername

host testservername returns: Host testsservername not found: 3(NXDOMAIN)

Thanks
GSK
0
Comment
Question by:gskortz
4 Comments
 
LVL 31

Accepted Solution

by:
farzanj earned 350 total points
ID: 38737518
host command will query DNS not /etc/hosts file

You can query like

getent ahosts testsservername
0
 
LVL 37

Expert Comment

by:Gerwin Jansen
ID: 38737520
What is in your /etc/host.conf ?

It should contain:

order hosts,bind
0
 
LVL 23

Assisted Solution

by:savone
savone earned 150 total points
ID: 38737935
try ping, which will use the service is nsswitch.

try:

ping testservername

It should show the IP address it gets from /etc/hosts.
0
 

Author Comment

by:gskortz
ID: 38738224
Responding to several comments:
/etc/hosts.conf does contain expect order = hosts,bind

ping does resolve to the expected address so /etc/nsswitch.conf or host.conf acting as expected.

getent hosts [hostname] provides what I need.
0

Featured Post

Give your grad a cloud of their own!

With up to 8TB of storage, give your favorite graduate their own personal cloud to centralize all their photos, videos and music in one safe place. They can save, sync and share all their stuff, and automatic photo backup helps free up space on their smartphone and tablet.

Question has a verified solution.

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

Suggested Solutions

Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
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…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

920 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now