[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

DNS and HOSTS file name resolution priority in Windows XP Media Center Edition

Posted on 2006-05-26
16
Medium Priority
?
2,141 Views
Last Modified: 2008-01-09
I recently got a new laptop with Windows XP Media Center Edition.  On all my other machines (running Home or Professional), the HOSTS file trumps the DNS server when it comes to domain name resolution.  But on my new laptop, it appears the DNS server is consulted before the HOSTS file.  This is inconvenient for me--I need to be able to override the outside DNS server's resolution wtih my own patch (for domain website testing, etc...).  I've tried tweaking the HostsPriority value in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\ServiceProvider (made the value for HostsPriority smaller than that for DnsPriority) to no avail.  Can anyone help?

Thanks!
0
Comment
Question by:scotru
  • 7
  • 5
  • 3
  • +1
16 Comments
 
LVL 32

Expert Comment

by:rsivanandan
ID: 16773848
Did you change it for both HostsPriority? Also after that you need to reboot, did you try that?

Cheers,
Rajesh
0
 

Author Comment

by:scotru
ID: 16774024
Thanks for your suggestion.  I did a registry search for HostsPriority and found 3 spots--but they all changed when I changed the one.  I also tried the reboot.  It appears to me something has changed in media center edition--perhaps in response to all the hosts file hijack viruses.   Any other suggestions greatly appreciated.

Thanks!
0
 
LVL 23

Expert Comment

by:Erik Bjers
ID: 16775828
you can manualy overide DNS by going to the IP addres in IE and not the web site name.

I'm not sure why MC is not reading the host file first (check if it's properly formated and in the correct place)

Also run ipconfig /flushdns from the command prompt, if you have been to the sites before the DNS lookup is cached on your system so neither the host file or dns is checked.

eb

0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:scotru
ID: 16776732
Thanks for your comment.  I've tried the DNS cache flushing to no avail.  The file is located in C:\WINDOWS\SYSTEM32\DRIVERS\ETC (which matches the path in the DatabasePath value in the above named registry key).  The hosts file is being read because other entries that are in the HOSTS file but are not available from DNS are resolving.  However for some reason, if there is a DNS entry, it is trumping the HOSTS file in name resolution priority.  Thanks for any additional help anyone can provide.

Thanks!

0
 

Author Comment

by:scotru
ID: 16776735
P.S.  Going to the IP address directly won't work for me because the server hosts multiple sites and needs the right name when vsiiting to bring up the correct site.

Thanks!
0
 
LVL 23

Expert Comment

by:Erik Bjers
ID: 16777349
Sorry, I got nothing then...

If I come up with anything I will post

eb
0
 
LVL 51

Expert Comment

by:Keith Alabaster
ID: 16783496
I am not aware of media edition doing anything differently in respect of DNS/hosts file resolving to any other system. Is your laptop fully patched up?



0
 

Author Comment

by:scotru
ID: 16784849
Yea, fully patched and I run Adaware and Spybot periodically.  I use AVG for antivirus.  I've had this problem since I got it brand new a couple of months ago.  I just assumed it must have been a media center edition change.  Does anyone out there have a copy of Media Center Edition that could confirm or disconfirm that DNS trumps the HOSTS file in name resolution?
0
 
LVL 23

Expert Comment

by:Erik Bjers
ID: 16785186
On my MediaCenter hosts was read first.  I put an entry in host file for google pointing to an MSN IP, when I went to google I got MSN.

can you post the text from your host file, it may help resolve the issue

also check the event log for any errors when you try to do the resolution using host file.

eb
0
 
LVL 51

Expert Comment

by:Keith Alabaster
ID: 16785270
Ditto
0
 
LVL 51

Expert Comment

by:Keith Alabaster
ID: 16787428
have you tried copying over an existing hosts file from one of you other workstations or did you create a new one for this machine?

Assume you have not put # symbols in front of the entries?
Also, if you edited the file in notepad, has it added the .txt extension to the hosts file? Unless you have selected to 'show extensions of known filetypes', the .txt extension will be hidden. Open the hosts file again and save it as "hosts" including the quotation marks and make sure the file type is set to 'all files'

0
 
LVL 23

Accepted Solution

by:
Erik Bjers earned 500 total points
ID: 16791274
Got a couple things for you to try

run nbtstat -RR from the command prompt (this will purg and refresh)

and check the host file to make sure everyone group has read access

eb
0
 

Author Comment

by:scotru
ID: 16803614
Greetings,

Thanks for all the suggestions.  As per request, here is my current hosts file.  The only difference is that "mydomain" is actually a domain I have registered in the file.   I tried mapping the google name to an MSN server as ebjers suggested and didn't have any luck.

-- start of hosts file ---

# Copyright (c) 1993-1999 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

127.0.0.1       localhost
207.68.172.246  google.com
207.68.172.246  www.google.com
192.168.1.10      mydomain.dnsalias.com
192.168.1.10      dev

-- end of file ---


Here is pinging  dev:

Pinging dev [192.168.1.10] with 32 bytes of data:

Reply from 192.168.1.10: bytes=32 time=1ms TTL=64
Reply from 192.168.1.10: bytes=32 time=2ms TTL=64
Reply from 192.168.1.10: bytes=32 time=2ms TTL=64
Reply from 192.168.1.10: bytes=32 time=2ms TTL=64

Ping statistics for 192.168.1.10:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 1ms, Maximum = 2ms, Average = 1ms

-- end of ping ---

As you can see, pinging dev resolves correctly.  And here is pinging mydomain.homeip.net [mydomain again is a replacement for privacy and the xxx in the IP address are also replacements for privacy].

Pinging mydomain.dnsalias.com [207.xxx.xxx.xxx] with 32 bytes of data:

Reply from 207.xxx.xxx.xxx: bytes=32 time=1ms TTL=255
Reply from 207.xxx.xxx.xxx: bytes=32 time=6ms TTL=255
Reply from 207.xxx.xxx.xxx: bytes=32 time=3ms TTL=255
Reply from 207.xxx.xxx.xxx: bytes=32 time=2ms TTL=255

Ping statistics for 207.xxx.xxx.xxx:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 1ms, Maximum = 6ms, Average = 3ms

Clearly it isn't mapping to the local [192.168.1.10] address that I specified in the hosts file.
0
 

Author Comment

by:scotru
ID: 16803648
Just tried changing the permissions on the hosts file (added read rights to the "Everyone" group).  After this I had to do the ipconfig /flushdns and then everything worked!  Yay!  Thanks a bunch to everyone for their help and particularly to you ebjers.  I'm trying to figure out how to give you a "tip" as I think your persistence and solution is worth more than the 125 points, I offered.

I had not changed the default permissions on the hosts file, but apparently it needed to have that Everyone read permission added.  As a side note, it's previous permissions had been full access for three objects: SYSTEM, Administrators, and the user I was logged in under.

Thanks again to everyone for their helpful suggestions and I hope this thread is helpful to someone else as well.


0
 

Author Comment

by:scotru
ID: 16803653
P.S.  I confirmed this was the solution, by removing the permission and flush the cache and the forwarding did indeed quite working until I restored the permission.
0
 
LVL 23

Expert Comment

by:Erik Bjers
ID: 16803892
scotru, no need for a tip I'm glad you got it working.  I have goten plenty of answers from this site so the best tip would be to answer the questions you can and help others.

eb
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Nslookup is a command line driven utility supplied as part of most Windows operating systems that can reveal information related to domain names and the Internet Protocol (IP) addresses associated with them. In simple terms, it is a tool that can …
This is the first one of a series of articles I’ll be writing to address technical issues that are always referred to as network problems. The network boundaries have changed, therefore having an understanding of how each piece in the network  puzzl…
Integration Management Part 2
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question