Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Servers & Networking
FedoraForum Search

Forgot Password? Join Us!

Servers & Networking Discuss any Fedora server problems and Networking issues such as dhcp, IP numbers, wlan, modems, etc.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 14th May 2012, 05:57 PM
broadstairs Offline
Registered User
 
Join Date: Oct 2011
Posts: 177
linuxfirefox
Assistance please with /etc/hosts

Now I dont often have to mess with my local network but I have an application which needs to use dns lookup to find another PC on my local lan (it assumes anything in its config to be a name and not an IP address!)) so what I thought I could do was to add the relevant name and IP address to my /etc/hosts file and after a restart any request for the defined host name would be returned the IP address from the hosts file. However this is not working. I have added a line in hosts :-

192.168.0.8 weather.com

which I thought should work.

Can some one please help? What have I done wrong?

Stuart

Last edited by broadstairs; 14th May 2012 at 05:58 PM. Reason: Spelling!
Reply With Quote
  #2  
Old 14th May 2012, 06:25 PM
jpollard Online
Registered User
 
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 6,107
linuxfirefox
Re: Assistance please with /etc/hosts

Should work as long as you have a system identified with the IP number 192.168.0.8.

Can you ping it?

One note: the /etc/nsswitch.conf file must have a line like: "hosts: files dns".

Last edited by jpollard; 14th May 2012 at 06:28 PM.
Reply With Quote
  #3  
Old 14th May 2012, 06:58 PM
broadstairs Offline
Registered User
 
Join Date: Oct 2011
Posts: 177
linuxfirefox
Re: Assistance please with /etc/hosts

Yes that system does exist and I can ping it.

Stuart
Reply With Quote
  #4  
Old 14th May 2012, 08:12 PM
lightman47 Offline
Registered User
 
Join Date: Apr 2009
Posts: 266
linuxfirefox
Re: Assistance please with /etc/hosts

did you try a reboot after editing it's hosts? I don't believe that's the problem but shouldn't hurt anything.
Reply With Quote
  #5  
Old 14th May 2012, 08:14 PM
broadstairs Offline
Registered User
 
Join Date: Oct 2011
Posts: 177
linuxfirefox
Re: Assistance please with /etc/hosts

Yup, rebooted as well and still no luck.....

Stuart
Reply With Quote
  #6  
Old 14th May 2012, 08:34 PM
lightman47 Offline
Registered User
 
Join Date: Apr 2009
Posts: 266
linuxfirefox
Re: Assistance please with /etc/hosts

First two lines should have NO hard coded references to it's own (or any other) machine name. For instance, mine (correctly) reads:

127.0.0.1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6


- just shots in the dark; thngs that have raised he** with me.
Reply With Quote
  #7  
Old 14th May 2012, 08:50 PM
trigpoint Offline
Registered User
 
Join Date: Dec 2004
Location: Shropshire, UK
Posts: 676
linuxubuntufirefox
Re: Assistance please with /etc/hosts

I think there should be a tab between the ip and the name. Another stab in the dark.
Reply With Quote
  #8  
Old 14th May 2012, 09:17 PM
lightman47 Offline
Registered User
 
Join Date: Apr 2009
Posts: 266
linuxfirefox
Re: Assistance please with /etc/hosts

I can't speak to latest versions, but tab/space used to be both ok ...

---------- Post added at 03:56 PM ---------- Previous post was at 03:53 PM ----------

Wait a sec - you can PING via IP, but not name - which is in your hosts.

- wonder if you're not running something that needs to be running.

What happens (on that machine) when you ping:
127.0.0.1
localhost
{that same machines' name - the one with the hosts that don't work}
{you're pinging the "inside" of the card (twice), then the "ouside"}
?
Am trying to see if it resolves ANY names (i.e. - it's OWN)

<Still stabs in the dark>.

---------- Post added at 04:14 PM ---------- Previous post was at 03:56 PM ----------

You haven't 'adjusted' any firewall settings?

If SELinux is running, I might try turning it off & rebooting - then try your pings by name.

{Really scratching here - betcha someone pops on here with the REAL answer}

---------- Post added at 04:17 PM ---------- Previous post was at 04:14 PM ----------

/etc/resolv.conf - what's in that?

Mine contains (in order), my SERVER(gateway) IP, my DSL modem IP, their DNS server IP. (See below). It's probably not correct; I'm not fantastic at this - but it works.

# Generated by NetworkManager
nameserver 192.168.0.253
nameserver 192.168.1.254
nameserver 166.102.165.13
# NOTE: the libc resolver may not support more than 3 nameservers.

Last edited by lightman47; 14th May 2012 at 09:32 PM.
Reply With Quote
  #9  
Old 14th May 2012, 10:46 PM
Doug G Offline
Registered User
 
Join Date: Jul 2005
Posts: 640
windows_7firefox
Re: Assistance please with /etc/hosts

Another thing, if you need to resolve any subdomains like www. you need to add another line in your hosts file.
__________________
======
Doug G
======
Reply With Quote
  #10  
Old 15th May 2012, 08:10 AM
broadstairs Offline
Registered User
 
Join Date: Oct 2011
Posts: 177
linuxfirefox
Re: Assistance please with /etc/hosts

OK now I have gotten my act together I can report after booting up this morning that I can ping the relevant PC by both its IP address and name so the hosts file IS resolving it OK.

This means I have an application problem.

Thanks for all the suggestions...

Stuart
Reply With Quote
Reply

Tags
assistance, or etc or hosts

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
/etc/hosts.allow and hosts.deny bigmacbb63 Security and Privacy 9 19th March 2010 10:22 PM
Assistance with YUM ImmortalMatrixo Using Fedora 0 15th June 2009 12:57 PM
rpm assistance Toast2120 Using Fedora 1 24th March 2009 01:56 AM
how to configure hosts.allow and hosts.deny nkjha Security and Privacy 4 19th January 2009 03:10 PM
Need assistance! Iggzaplaya Installation and Live Media 7 27th August 2007 08:13 PM


Current GMT-time: 14:10 (Friday, 24-05-2013)

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