Solved

RHEL Name Resolution Local Host file and DNS

Posted on 2013-01-02
4
921 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

How many times have you wanted to quickly do the same thing to a list but found yourself typing it again and again? I first figured out a small time saver with the up arrow to recall the last command but that can only get you so far if you have a bi…
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 several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

757 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

19 Experts available now in Live!

Get 1:1 Help Now