Solved

RHEL Name Resolution Local Host file and DNS

Posted on 2013-01-02
4
1,009 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

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

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…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses

734 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