Fedora Linux Support Community & Resources Center
  #1  
Old 7th August 2012, 11:21 PM
nvargas123 Offline
Registered User
 
Join Date: Aug 2012
Location: Managua
Posts: 1
windows_xp_2003firefox
Not resolving /etc/hosts

Hello everybody,

I've been trying to make a Fedora Core 11 box to resolve using its hosts file but it just wont.

The /etc/hosts file reads:

Code:
127.0.0.1 localhost.localdomain localhost
172.16.100.132 server.domain.com server
I've checked the /etc/host.conf file and it reads:

Code:
multi on
order hosts,bind
And the nsswitch.conf file reads:

Code:
hosts:      files dns
When I run the host `hostname -f` it still shows the DNS IP number and not the address listed on the hosts file:

Code:
server.domain.com has address aaa.bbb.ccc.ddd
Tried rebooting and still no change, but when I ping the hostname, it uses the hosts address.

Code:
[root@server etc]# ping `hostname -f`
PING server.domain.com (172.16.100.132) 56(84) bytes of data.
64 bytes from server.domain.com (172.16.100.132): icmp_seq=1 ttl=64 time=0.033 ms
64 bytes from server.domain.com (172.16.100.132): icmp_seq=2 ttl=64 time=0.025 ms
64 bytes from server.domain.com (172.16.100.132): icmp_seq=3 ttl=64 time=0.023 ms
Any ideas?
Reply With Quote
  #2  
Old 8th August 2012, 04:32 AM
nsnbm Offline
Registered User
 
Join Date: Dec 2007
Location: Australia
Posts: 427
linuxfirefox
Re: Not resolving /etc/hosts

Guess: is it resolving using your /etc/resolv.conf file? But that doesn't make much sense either. Sorry.

Last edited by nsnbm; 8th August 2012 at 10:04 AM.
Reply With Quote
  #3  
Old 8th August 2012, 02:06 PM
distributer Offline
Registered User
 
Join Date: Aug 2009
Location: UK
Posts: 109
windows_7firefox
Re: Not resolving /etc/hosts

You use comma in your /etc/host.conf, but it states on the man page:
Quote:
Fields can be separated by white space, consisting of either one or more spaces or tabs.
http://tldp.org/LDP/nag/node82.html
Did try a white-space?
Reply With Quote
  #4  
Old 8th August 2012, 03:46 PM
stevea Online
Registered User
 
Join Date: Apr 2006
Location: Ohio, USA
Posts: 8,810
linuxfirefox
Re: Not resolving /etc/hosts

'hostname' w/o arguments just returns the value of the (man 2 uname) uname syscall, and this has no necessary connection to any network hostname. BY CONVENTION uname 'nodename' string should be a FQDN, but many systems violate this recommendation. So 'hostname w/o argument doesn't consult /etc/hosts ,nor dns or anything else - it makes a local syscall.

Since the uname.nodename may be an unqualified hostname, one suggested way to get a fqdn is to first lookup the IP address for the unqualified nodename, then second do a reverse lookup of the IP address to get the fqdn. Perhaps this is what ancient (F11) 'hostname -f' does.

The current hostname calls 'getaddrinfo' with the uname value, and this works as expected (stops at /etc/hostname, even despite the typo) .
__________________
None are more hopelessly enslaved than those who falsely believe they are free.
Johann Wolfgang von Goethe
Reply With Quote
  #5  
Old 8th August 2012, 04:35 PM
Dan Offline
Administrator
 
Join Date: Jun 2006
Location: Paris, TX
Posts: 23,264
linuxfirefox
Re: Not resolving /etc/hosts

Move to EOL.
Reply With Quote
Reply

Tags
host.conf, hosts, nsswitch, or etc or hosts, resolve, resolving

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Entries in /etc/hosts not resolving BillGradwohl Using Fedora 7 17th November 2011 04:08 PM
how to configure hosts.allow and hosts.deny nkjha Security and Privacy 4 19th January 2009 03:10 PM
Slow resolving hosts in anything HELP??? garymayor Servers & Networking 5 2nd February 2005 09:36 PM
Web browsers slow at resolving hosts in FC2 jdc EOL (End Of Life) Versions 5 20th May 2004 02:56 AM


Current GMT-time: 11:38 (Tuesday, 02-09-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat