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


PC's ignoring Host file entrys and using DNS

Medium Priority
Last Modified: 2012-05-06

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.
Watch Question

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

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:          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:          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:          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.
Top Expert 2013

There are some other ideas here:
When you flush the DNS then if you run a ipconfig /displaydns  what is the output?


Yes thats what i thought

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

The address in DNS for the FQDN is

I have flushed dns but when it try and ping either the FQDN or just testserver01 it returns the 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




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.
Top Expert 2013
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
Top Expert 2008

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

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.


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.