Member_2_231077
asked on
Get windows to use hosts before DNS
How do I make windows look in a local hosts file before it queries DNS without third party add-on software?
Example hosts file (I had to go to dos prompt to get rid of the extension)
127.0.0.1 localhost
208.50.148.12 www.microsoft.com
10.1.2.3 www.foo.com
DNS resolution is set to the ISP's server.
when I type www.foo.com in my browser I see the local server OK. When I type www.microsoft.com I see M$'s server but I want to see EE's server which is the IP address in hosts file.
I can work around it by adding my own DNS server or using addons but that's not the Q. A reg tweak would be cool.
Example hosts file (I had to go to dos prompt to get rid of the extension)
127.0.0.1 localhost
208.50.148.12 www.microsoft.com
10.1.2.3 www.foo.com
DNS resolution is set to the ISP's server.
when I type www.foo.com in my browser I see the local server OK. When I type www.microsoft.com I see M$'s server but I want to see EE's server which is the IP address in hosts file.
I can work around it by adding my own DNS server or using addons but that's not the Q. A reg tweak would be cool.
Here
http://www.mcpmag.com/members/97novdec/col4main.asp
Isn't the internet grand !!
I hope this helps !
http://www.mcpmag.com/members/97novdec/col4main.asp
Isn't the internet grand !!
I hope this helps !
And finally - a better explanation at
http://ctdp.tripod.com/os/windows/wintcp/wtcpname.html
http://ctdp.tripod.com/os/windows/wintcp/wtcpname.html
ASKER
Look Sys, get your web browser to go to https://www.experts-exchange.com when you type www.microsoft.com before you comment in this thread again please.
ASKER
I am going to delete this question and post it again with exactly the same wording and if some dork that does not know the difference between netbios and DNS f**ks it up again I'll quit EE.
>>Exchange is like a game. Some Experts play the game by providing a large quantity of poor answers.
same goes for comments in my book.
Hope this hepls.
>>Exchange is like a game. Some Experts play the game by providing a large quantity of poor answers.
same goes for comments in my book.
Hope this hepls.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
edit yours again, reboot, and see if it works for you
ASKER
It is nearly midnight, I'll try again tomorrow. Haven't tried ME, but it don't work with 95, 98 or nt4, sure you haven't got anything extra added?
positive, standard install
and again I point out the link from M$ in my above post
G'nite Andy
Steve
and again I point out the link from M$ in my above post
G'nite Andy
Steve
ASKER
>I did my test on a fresh boot (no prior dns entries or resolution)
Ah, "no prior DNS entries" but I have dns entry for the ISP's resolver in my config as I say in the question. Can you try again with a resolver configured.
Ah, "no prior DNS entries" but I have dns entry for the ISP's resolver in my config as I say in the question. Can you try again with a resolver configured.
I will when I get home, as I have ip config info on my machine (dns entries)
OK Andy, I tried it at home (w98 se networked to my main, which is using ICS, so I have dns entries on my NIC. Two of them, one my main machine 192.168.0.1, and one is my isp. I made the entry to the hosts file, and it resolved it to here.
208.50.148.12 www.microsoft.com
so the question is why isn't your machine resolving from the hosts file first.
1.) you have the reg entries as mentioned in Sys's posts
2.) the hosts file is not configured correctly, so forgive me if I review the hosts file
must be named hosts, no extension (not .txt or .sam) just "hosts"
must be in c:\windows (if 9x) or %systemroot%\system32 (if NT/2000)
can not have the # pound sign in front of the entries
there must be at least one space between the ip address and the host name
Steve
208.50.148.12 www.microsoft.com
so the question is why isn't your machine resolving from the hosts file first.
1.) you have the reg entries as mentioned in Sys's posts
2.) the hosts file is not configured correctly, so forgive me if I review the hosts file
must be named hosts, no extension (not .txt or .sam) just "hosts"
must be in c:\windows (if 9x) or %systemroot%\system32 (if NT/2000)
can not have the # pound sign in front of the entries
there must be at least one space between the ip address and the host name
Steve
probably I may have not read some essential phrases in the long dialog above, but my %systemroot%\system32\driv ers\etc\ho sts works if in the TCP/IP settings WINS tab the LMHOSTS query is enabled.
If you also need NetBIOS ther is a NetBIOS over TCP/IP checkbox too.
I never reboot when changing my hosts file (even this is a must for any change on M$ systems :), and also have never noticed any problems with cached mappings.
I also know that the TCP/IP nodetype should be set to hybrid (dezimal 7?) in the registry. You'll see the setting with the ipconfig -all command.
BTW, I do not "play the game by providing a large quantity of poor answers", I'm just wondering ...
If you also need NetBIOS ther is a NetBIOS over TCP/IP checkbox too.
I never reboot when changing my hosts file (even this is a must for any change on M$ systems :), and also have never noticed any problems with cached mappings.
I also know that the TCP/IP nodetype should be set to hybrid (dezimal 7?) in the registry. You'll see the setting with the ipconfig -all command.
BTW, I do not "play the game by providing a large quantity of poor answers", I'm just wondering ...
ASKER
My apologies to sysexpert for being rude but it was nothing to do with netbios.
Following Steve's 2nd and 3rd URL led me to Q139270 and I see someone changed the registry keys to force DNS first.
Following Steve's 2nd and 3rd URL led me to Q139270 and I see someone changed the registry keys to force DNS first.
Andy Glad we were able to get this all staighten out
Steve
Steve
http://www.winguides.com/registry/display.php/739/
I hope this helps !