LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 05-18-2004, 11:43 AM   #1
iftiuk
Member
 
Registered: Apr 2004
Location: Washington DC
Posts: 43

Rep: Reputation: 15
/etc/hosts


A generic question. When /etc/hosts is modified, does the computer needs a reboot? How does it know that there is a new information in this file.

Thanks
 
Old 05-18-2004, 12:31 PM   #2
Muzzy
Member
 
Registered: Mar 2004
Location: Denmark
Distribution: Gentoo, Slackware
Posts: 333

Rep: Reputation: 30
The changes take effect immediately:
Code:
# ping squiggle
ping: unknown host squiggle
# echo "192.168.0.3 squiggle" >> /etc/hosts
ping squiggle
PING squiggle (192.168.0.3) 56(84) bytes of data.
64 bytes from squiggle (192.168.0.3): icmp_seq=1 ttl=64 time=0.160 ms
64 bytes from squiggle (192.168.0.3): icmp_seq=2 ttl=64 time=0.139 ms
I guess it checks the file modification date or something?
 
Old 05-18-2004, 01:03 PM   #3
LuggerHouse
Member
 
Registered: May 2004
Location: Montreal,QC,Canada
Distribution: Fedora Core 7
Posts: 210

Rep: Reputation: 30
Ping or anyother soft wich need to do DNS resolution wont check the timestamp of /etc/hosts. It reads it every time, that is it. :-) The order of DNS resolution can be configured in /etc/nsswitch with enbtries like

hosts: db files nisplus nis dns

Meaning where to look at to get DNS Resolution.
 
Old 05-18-2004, 01:03 PM   #4
adm1329
Member
 
Registered: Mar 2004
Distribution: CentOS 5
Posts: 128

Rep: Reputation: 17
I don't think it checks to see when the file was modified, I think it actually checks the hosts file anytime you request something to make see if it's there before querying dns.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
External Hosts Resolve but Local Hosts Do Not kjm9 Linux - Networking 7 11-19-2005 03:51 PM
hosts.allow & hosts.deny question... jonc Linux - Security 9 03-05-2005 09:41 PM
Adding shell commands to hosts.deny and hosts.allow ridertech Linux - Security 3 12-29-2003 03:52 PM
hosts.deny and hosts.allow defaults? gui10 Linux - Security 5 12-20-2001 01:57 AM
hosts.allow / hosts.deny fistz Linux - Newbie 1 04-19-2001 07:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:12 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration