We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

PC's ignoring Host file entrys and using DNS

Medium Priority
980 Views
Last Modified: 2012-05-06
Hi

We have a few instances where we use a local host file to overide an address in DNS on certain servers / PC's. We are all finding that if we create an entry in the host file and specify a different IP address its ignored and still returns the address in DNS.

I have tried Flushing DNS on my local machines, is there anything else?

I though the default DNS resolution pattern was to query the local hosts file before the DNS server.
Comment
Watch Question

Commented:
can you set the IP address to a static IP address?
you can also get the MAC address of the PC's, and assign the stated entries based on the MAC addresses - this still uses the DNS system, however, only a PC with X mac address will be assigned IP address X.X.X.X
CERTIFIED EXPERT

Commented:
It shouldn't matter if you are using static or dynamic addresses.
And I don't know how MAC addresses really fit into the picture... DNS is hostname to IP Address translation. MAC addresses fall into a different layer of the OSI model altogether because you can't route using a MAC address.

Anyhow, yes there is a default order that says to check the local hosts file before DNS.

However, depending on what the contents of your host file are, and whether there are aliases there, you may not have the information you want to be there.

For example, if you are looking for a server called "server1" and you have a host entry that looks like:
192.168.0.1          server1
Then it should work.

But your client won't only be looking for server1, it is looking for a fully qualified domain name, in which case you want your host file to show:
192.168.0.1          server1.mydomain.com

And of course, then there are the issues of NetBIOS resolution in which case only the short name is used. So the following addresses both ways:
192.168.0.1          server1.mydomain.com          server1

Without knowing the contents of the hosts file, or your DNS suffix search order, or the host you are looking for, it's harder to give a more complete answer.

Oh, and you were on the right track with one thing... if you have a cached resolution on the client, you'll need to do an ipconfig /flushdns before testing.
CERTIFIED EXPERT
Top Expert 2013

Commented:
There are some other ideas here:
http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/Windows/XP/Q_21604864.html?sfQueryTermInfo=1+file+host+ignor
When you flush the DNS then if you run a ipconfig /displaydns  what is the output?
Thanks
MIke

Author

Commented:
Yes thats what i thought

I have added to my hostfile
10.0.0.10     testserver01
10.0.0.10     testserver01.mydomain.local

The address in DNS for the FQDN is 10.100.1.10

I have flushed dns but when it try and ping either the FQDN or just testserver01 it returns the 10.100.1.10 address

I have pasted a section of the ipconfig command, im out of ideas, i can kind of see there could be netbios name resolution comming into effect when just pinging the hostname, nut the FQDN still ignoring the hosy file i cant see how / why.

  Host Name . . . . . . . . . . . . : ITPC06
  Primary Dns Suffix  . . . . . . . : mydomain.local
  Node Type . . . . . . . . . . . . : Broadcast
  IP Routing Enabled. . . . . . . . : No
  WINS Proxy Enabled. . . . . . . . : No
  DNS Suffix Search List. . . . . . : mydomain.local

Thanks

Nick

Author

Commented:
OK just got it working, i have renamed the hosts file on a couple of machines to hostsold and then created a new file and it works

Cant think of why the hosts files on multiple machines would corrupt though.
CERTIFIED EXPERT
Top Expert 2013
Commented:
Did you check the permissions/attributes on the prior hosts file versus the new one?  

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Paul SolovyovskySenior IT Advisor
CERTIFIED EXPERT
Top Expert 2008

Commented:
check lmhosts file and WINS, it may be overriding your hosts

http://www.experts-exchange.com/Networking/Windows_Networking/NT/Q_22010307.html
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.