HTFC Forums

H.T.F.C.

How To Fix Computers





Go Back   HTFC Forums > Software Newsgroups > Windows XP > XP Networking

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1  
Old 01-27-2008, 01:38 PM
antonio.caprio@gmail.com
 
Posts: n/a
Default Hosts and DNS

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
Reply With Quote
Sponsored Links
  #2  
Old 01-27-2008, 03:37 PM
Robert L. \(MS-MVP\)
 
Posts: n/a
Default Re: Hosts and DNS

Correct. hosts file has priority. In most cases, we don't use hosts file.

--
Bob Lin, MS-MVP, MCSE & CNE
Networking, Internet, Routing, VPN Troubleshooting on
http://www.ChicagoTech.net
How to Setup Windows, Network, VPN & Remote Access on
http://www.HowToNetworking.com


<antonio.caprio@gmail.com> wrote in message
news:90ccd90f-b41b-449d-82c6-f645435161d3@e6g2000prf.googlegroups.com...
> 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


Reply With Quote
  #3  
Old 01-27-2008, 04:06 PM
Chuck [MVP]
 
Posts: n/a
Default Re: Hosts and DNS

On Sun, 27 Jan 2008 05:38:18 -0800 (PST), antonio.caprio@gmail.com wrote:

>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/0...on-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/0...lution-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.
Reply With Quote
  #4  
Old 01-27-2008, 05:02 PM
antonio.caprio@gmail.com
 
Posts: n/a
Default Re: Hosts and DNS

On Jan 27, 5:06 pm, "Chuck [MVP]" <n...@example.net> wrote:
> On Sun, 27 Jan 2008 05:38:18 -0800 (PST), antonio.cap...@gmail.com wrote:
> >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/0...on-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/0...dress-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
Reply With Quote
  #5  
Old 01-27-2008, 06:05 PM
Lanwench [MVP - Exchange]
 
Posts: n/a
Default Re: Hosts and DNS

antonio.caprio@gmail.com wrote:
> On Jan 27, 5:06 pm, "Chuck [MVP]" <n...@example.net> wrote:
>> On Sun, 27 Jan 2008 05:38:18 -0800 (PST), antonio.cap...@gmail.com
>> wrote:
>>> 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/0...on-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/0...dress-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.


Reply With Quote
  #6  
Old 01-27-2008, 07:34 PM
antonio.caprio@gmail.com
 
Posts: n/a
Default Re: Hosts and DNS

On Jan 27, 7:05 pm, "Lanwench [MVP - Exchange]"
<lanwe...@heybuddy.donotsendme.unsolicitedmailatya hoo.com> wrote:
> antonio.cap...@gmail.com wrote:
> > On Jan 27, 5:06 pm, "Chuck [MVP]" <n...@example.net> wrote:
> >> On Sun, 27 Jan 2008 05:38:18 -0800 (PST), antonio.cap...@gmail.com
> >> wrote:
> >>> 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/0...on-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/0...dress-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

>
> > Antonio

>
> 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
Reply With Quote
  #7  
Old 01-29-2008, 01:46 PM
Lanwench [MVP - Exchange]
 
Posts: n/a
Default Re: Hosts and DNS

antonio.caprio@gmail.com wrote:

<snip>

>> 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


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.


Reply With Quote
  #8  
Old 01-29-2008, 03:58 PM
Chuck [MVP]
 
Posts: n/a
Default Re: Hosts and DNS

On Sun, 27 Jan 2008 11:34:59 -0800 (PST), antonio.caprio@gmail.com wrote:

>On Jan 27, 7:05 pm, "Lanwench [MVP - Exchange]"
><lanwe...@heybuddy.donotsendme.unsolicitedmailaty ahoo.com> wrote:
>> antonio.cap...@gmail.com wrote:
>> > On Jan 27, 5:06 pm, "Chuck [MVP]" <n...@example.net> wrote:
>> >> On Sun, 27 Jan 2008 05:38:18 -0800 (PST), antonio.cap...@gmail.com
>> >> wrote:
>> >>> 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/0...on-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/0...dress-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.


>> > 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

>>
>> > Antonio

>>
>> 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/0...-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.
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
hosts services HHantu Windows Vista 0 01-11-2008 07:26 AM
Hosts File Query Skye Windows XP 4 11-08-2007 01:58 AM
Hosts file Racey Windows XP 5 09-18-2007 05:25 PM
Hosts wont save Druss Windows Vista 5 04-21-2007 06:18 PM
Use of the HOSTS File Arthur Shapiro Windows XP 1 04-09-2007 07:53 PM


All times are GMT. The time now is 09:34 AM.


Powered by vBulletin® Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0
© 2004 - 2007 Web-S-Sense Pty. Ltd. Usenet and forums posts © their respective authors.
Ad Management by RedTyger