Solved

RHEL Name Resolution Local Host file and DNS

Posted on 2013-01-02
4
1,021 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
[X]
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
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 38

Expert Comment

by:Gerwin Jansen, EE MVE
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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
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…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

724 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