Hosts and DNS

  • Thread starter Thread starter antonio.caprio
  • Start date Start date
A

antonio.caprio

Hi,
it seems that windows xp sp2 queries DNS server to resolve names that
it already knows because names exist in the hosts file, sometime it
spends a lot of time to do this (DNS problem of course), however the
hosts file has priority because the IP from hosts file is returned and
IP from DNS is ignored. Is it right? How can I avoid that?
Thank you

Antonio
 
Hi,
it seems that windows xp sp2 queries DNS server to resolve names that
it already knows because names exist in the hosts file, sometime it
spends a lot of time to do this (DNS problem of course), however the
hosts file has priority because the IP from hosts file is returned and
IP from DNS is ignored. Is it right? How can I avoid that?
Thank you

Antonio

Antonio,

For accessing local resources (computers on the LAN), most computers running
Windows XP don't use DNS, they do name resolution broadcasts. For name
resolution, broadcasts have priority. You can change the resolution type, if
you wish.
<http://nitecruzr.blogspot.com/2005/05/address-resolution-on-lan.html>
http://nitecruzr.blogspot.com/2005/05/address-resolution-on-lan.html

For accessing remote resources, a Hosts file will override DNS use.
<http://nitecruzr.blogspot.com/2005/07/local-name-and-address-resolution-on.html>
http://nitecruzr.blogspot.com/2005/07/local-name-and-address-resolution-on.html

Use of the Hosts file is a built-in part of IP networking. If you don't want
the Hosts file, being accessed, to interfere, don't put entries in the file. An
empty file will send all queries to DNS.

--
Cheers,
Chuck, MS-MVP 2005-2007 [Windows - Networking]
http://nitecruzr.blogspot.com/
Paranoia is not a problem, when it's a normal response from experience.
My email is AT DOT
actual address pchuck mvps org.
 
Hi,
it seems that windows xp sp2 queries DNS server to resolve names that
it already knows because names exist in the hosts file, sometime it
spends a lot of time to do this (DNS problem of course), however the
hosts file has priority because the IP from hosts file is returned and
IP from DNS is ignored. Is it right? How can I avoid that?
Thank you

Antonio,

For accessing local resources (computers on the LAN), most computers running
Windows XP don't use DNS, they do name resolution broadcasts. For name
resolution, broadcasts have priority. You can change the resolution type, if
you wish.
<http://nitecruzr.blogspot.com/2005/05/address-resolution-on-lan.html>http://nitecruzr.blogspot.com/2005/05/address-resolution-on-lan.html

For accessing remote resources, a Hosts file will override DNS use.
<http://nitecruzr.blogspot.com/2005/07/local-name-and-address-resoluti...>http://nitecruzr.blogspot.com/2005/07/local-name-and-address-resoluti...

Use of the Hosts file is a built-in part of IP networking. If you don't want
the Hosts file, being accessed, to interfere, don't put entries in the file. An
empty file will send all queries to DNS.

--
Cheers,
Chuck, MS-MVP 2005-2007 [Windows - Networking]http://nitecruzr.blogspot.com/
Paranoia is not a problem, when it's a normal response from experience.
My email is AT DOT
actual address pchuck mvps org.

Hi,
thank you all for yours answers, I'm sorry I think my english is too
poor to explain the problem, I will try by an example.
Scenario:
My hosts file
127.0.0.1 localhost
127.0.0.1 www.google.com

If I ping www.google.com I get the right response:
Esecuzione di Ping www.google.com [127.0.0.1] con 32 byte di dati:

Risposta da 127.0.0.1: byte=32 durata<1ms TTL=128
Risposta da 127.0.0.1: byte=32 durata<1ms TTL=128
Risposta da 127.0.0.1: byte=32 durata<1ms TTL=128

Where is the problem? When I have DNS problem I get response (right IP
response and expected time response) after a lot of time, then I think
that xindows xp is querying DNS despite it already knows the IP and
that is what I don't want, of course it is not a ping question for me,
that is only an example. I hope I've been more clearly.
Regards

Antonio
 
Hi,
it seems that windows xp sp2 queries DNS server to resolve names
that it already knows because names exist in the hosts file,
sometime it spends a lot of time to do this (DNS problem of
course), however the hosts file has priority because the IP from
hosts file is returned and IP from DNS is ignored. Is it right? How
can I avoid that?
Thank you

Antonio,

For accessing local resources (computers on the LAN), most computers
running Windows XP don't use DNS, they do name resolution
broadcasts. For name resolution, broadcasts have priority. You can
change the resolution type, if you wish.
<http://nitecruzr.blogspot.com/2005/05/address-resolution-on-lan.html>http://nitecruzr.blogspot.com/2005/05/address-resolution-on-lan.html

For accessing remote resources, a Hosts file will override DNS use.
<http://nitecruzr.blogspot.com/2005/07/local-name-and-address-resoluti...>http://nitecruzr.blogspot.com/2005/07/local-name-and-address-resoluti...

Use of the Hosts file is a built-in part of IP networking. If you
don't want the Hosts file, being accessed, to interfere, don't put
entries in the file. An empty file will send all queries to DNS.

--
Cheers,
Chuck, MS-MVP 2005-2007 [Windows -
Networking]http://nitecruzr.blogspot.com/ Paranoia is not a problem,
when it's a normal response from experience.
My email is AT DOT
actual address pchuck mvps org.

Hi,
thank you all for yours answers, I'm sorry I think my english is too
poor to explain the problem, I will try by an example.
Scenario:
My hosts file
127.0.0.1 localhost
127.0.0.1 www.google.com

If I ping www.google.com I get the right response:
Esecuzione di Ping www.google.com [127.0.0.1] con 32 byte di dati:

Risposta da 127.0.0.1: byte=32 durata<1ms TTL=128
Risposta da 127.0.0.1: byte=32 durata<1ms TTL=128
Risposta da 127.0.0.1: byte=32 durata<1ms TTL=128

Where is the problem? When I have DNS problem I get response (right IP
response and expected time response) after a lot of time, then I think
that xindows xp is querying DNS despite it already knows the IP and
that is what I don't want, of course it is not a ping question for me,
that is only an example. I hope I've been more clearly.
Regards

Antonio

Open your hosts file and see what you've got in it.
 
Hi,
it seems that windows xp sp2 queries DNS server to resolve names
that it already knows because names exist in the hosts file,
sometime it spends a lot of time to do this (DNS problem of
course), however the hosts file has priority because the IP from
hosts file is returned and IP from DNS is ignored. Is it right? How
can I avoid that?
Thank you
Antonio
Antonio,
For accessing local resources (computers on the LAN), most computers
running Windows XP don't use DNS, they do name resolution
broadcasts. For name resolution, broadcasts have priority. You can
change the resolution type, if you wish.
<http://nitecruzr.blogspot.com/2005/05/address-resolution-on-lan.html>http://nitecruzr.blogspot.com/2005/05/address-resolution-on-lan.html
For accessing remote resources, a Hosts file will override DNS use.
<http://nitecruzr.blogspot.com/2005/07/local-name-and-address-resoluti....>http://nitecruzr.blogspot.com/2005/07/local-name-and-address-resoluti...
Use of the Hosts file is a built-in part of IP networking. If you
don't want the Hosts file, being accessed, to interfere, don't put
entries in the file. An empty file will send all queries to DNS.
--
Cheers,
Chuck, MS-MVP 2005-2007 [Windows -
Networking]http://nitecruzr.blogspot.com/Paranoia is not a problem,
when it's a normal response from experience.
My email is AT DOT
actual address pchuck mvps org.
Hi,
thank you all for yours answers, I'm sorry I think my english is too
poor to explain the problem, I will try by an example.
Scenario:
My hosts file
127.0.0.1 localhost
127.0.0.1www.google.com
If I pingwww.google.comI get the right response:
Esecuzione di Pingwww.google.com[127.0.0.1] con 32 byte di dati:
Risposta da 127.0.0.1: byte=32 durata<1ms TTL=128
Risposta da 127.0.0.1: byte=32 durata<1ms TTL=128
Risposta da 127.0.0.1: byte=32 durata<1ms TTL=128
Where is the problem? When I have DNS problem I get response (right IP
response and expected time response) after a lot of time, then I think
that xindows xp is querying DNS despite it already knows the IP and
that is what I don't want, of course it is not a ping question for me,
that is only an example. I hope I've been more clearly.
Regards

Open your hosts file and see what you've got in it.

# Copyright (c) 1993-1999 Microsoft Corp.
#
# Questo è un esempio di file HOSTS usato da Microsoft TCP/IP per
Windows.
#
# Questo file contiene la mappatura degli indirizzi IP ai nomi host.
# Ogni voce dovrebbe occupare una singola riga. L'indirizzo IP
dovrebbe
# trovarsi nella prima colonna seguito dal nome host corrispondente.
# L'indirizzo e il nome host dovrebbero essere separati da almeno uno
spazio
# o punto di tabulazione.
#
# È inoltre possibile inserire commenti (come questi) nelle singole
righe
# o dopo il nome del computer caratterizzato da un simbolo '#'.
#
# Per esempio:
#
# 102.54.94.97 rhino.acme.com # server origine
# 38.25.63.10 x.acme.com # client host x

127.0.0.1 localhost
127.0.0.1 www.dummy.jeeg www.chorus.jeeg www.wiki.jeeg www.cms.jeeg

www.dummy.jeeg www.chorus.jeeg www.wiki.jeeg www.cms.jeeg are
virtualhosts on my local apache webserver.
You can check that I told, add an entry to your host file, ping it,
set a fake dns server on your system (both primary dns and secondary
dns ) ping again, you should have a delay before you get response.
Regards

Antonio
 
(e-mail address removed) wrote:

# Copyright (c) 1993-1999 Microsoft Corp.
#
# Questo è un esempio di file HOSTS usato da Microsoft TCP/IP per
Windows.
#
# Questo file contiene la mappatura degli indirizzi IP ai nomi host.
# Ogni voce dovrebbe occupare una singola riga. L'indirizzo IP
dovrebbe
# trovarsi nella prima colonna seguito dal nome host corrispondente.
# L'indirizzo e il nome host dovrebbero essere separati da almeno uno
spazio
# o punto di tabulazione.
#
# È inoltre possibile inserire commenti (come questi) nelle singole
righe
# o dopo il nome del computer caratterizzato da un simbolo '#'.
#
# Per esempio:
#
# 102.54.94.97 rhino.acme.com # server origine
# 38.25.63.10 x.acme.com # client host x

127.0.0.1 localhost
127.0.0.1 www.dummy.jeeg www.chorus.jeeg www.wiki.jeeg
www.cms.jeeg

www.dummy.jeeg www.chorus.jeeg www.wiki.jeeg www.cms.jeeg are
virtualhosts on my local apache webserver.
You can check that I told, add an entry to your host file, ping it,
set a fake dns server on your system (both primary dns and secondary
dns ) ping again, you should have a delay before you get response.
Regards

Antonio

Yes, I understand how to add entries to my hosts file. I am not sure what
the problem is with your system which prompts you to write. You should not
have a lot of entries in HOSTS - it will cause delays. You should be using
DNS as your primary means of name resolution.
 
Hi,
it seems that windows xp sp2 queries DNS server to resolve names
that it already knows because names exist in the hosts file,
sometime it spends a lot of time to do this (DNS problem of
course), however the hosts file has priority because the IP from
hosts file is returned and IP from DNS is ignored. Is it right? How
can I avoid that?
Thank you


For accessing local resources (computers on the LAN), most computers
running Windows XP don't use DNS, they do name resolution
broadcasts. For name resolution, broadcasts have priority. You can
change the resolution type, if you wish.
<http://nitecruzr.blogspot.com/2005/05/address-resolution-on-lan.html>http://nitecruzr.blogspot.com/2005/05/address-resolution-on-lan.html
Use of the Hosts file is a built-in part of IP networking. If you
don't want the Hosts file, being accessed, to interfere, don't put
entries in the file. An empty file will send all queries to DNS.
Hi,
thank you all for yours answers, I'm sorry I think my english is too
poor to explain the problem, I will try by an example.
Scenario:
My hosts file
127.0.0.1 localhost
127.0.0.1www.google.com
If I pingwww.google.comI get the right response:
Esecuzione di Pingwww.google.com[127.0.0.1] con 32 byte di dati:
Risposta da 127.0.0.1: byte=32 durata<1ms TTL=128
Risposta da 127.0.0.1: byte=32 durata<1ms TTL=128
Risposta da 127.0.0.1: byte=32 durata<1ms TTL=128
Where is the problem? When I have DNS problem I get response (right IP
response and expected time response) after a lot of time, then I think
that xindows xp is querying DNS despite it already knows the IP and
that is what I don't want, of course it is not a ping question for me,
that is only an example. I hope I've been more clearly.
Regards

Open your hosts file and see what you've got in it.

# Copyright (c) 1993-1999 Microsoft Corp.
#
# Questo è un esempio di file HOSTS usato da Microsoft TCP/IP per
Windows.
#
# Questo file contiene la mappatura degli indirizzi IP ai nomi host.
# Ogni voce dovrebbe occupare una singola riga. L'indirizzo IP
dovrebbe
# trovarsi nella prima colonna seguito dal nome host corrispondente.
# L'indirizzo e il nome host dovrebbero essere separati da almeno uno
spazio
# o punto di tabulazione.
#
# È inoltre possibile inserire commenti (come questi) nelle singole
righe
# o dopo il nome del computer caratterizzato da un simbolo '#'.
#
# Per esempio:
#
# 102.54.94.97 rhino.acme.com # server origine
# 38.25.63.10 x.acme.com # client host x

127.0.0.1 localhost
127.0.0.1 www.dummy.jeeg www.chorus.jeeg www.wiki.jeeg www.cms.jeeg

www.dummy.jeeg www.chorus.jeeg www.wiki.jeeg www.cms.jeeg are
virtualhosts on my local apache webserver.
You can check that I told, add an entry to your host file, ping it,
set a fake dns server on your system (both primary dns and secondary
dns ) ping again, you should have a delay before you get response.

The Hosts file is a component of Internet Protocol, that's been there since
before DNS was developed. If you don't want the delay, don't put things in the
Hosts file.

It's also possible that the delay is a result of running an Apache web server.
Have you done any performance analysis, with and without Apache running?
<http://nitecruzr.blogspot.com/2006/04/watching-what-your-computer-is-doing.html>
http://nitecruzr.blogspot.com/2006/04/watching-what-your-computer-is-doing.html

--
Cheers,
Chuck, MS-MVP 2005-2007 [Windows - Networking]
http://nitecruzr.blogspot.com/
Paranoia is not a problem, when it's a normal response from experience.
My email is AT DOT
actual address pchuck mvps org.
 
Back
Top