Test DNS Transfer with Windows Hosts File

Posted on January 1st, 2010 by Gabriel Harper

Here’s a simple trick you can use to test DNS changes on a Windows PC. You can fake or override DNS lookups by manually entering an IP address for any domain name you want. Use it to see if yoursite.com looks OK on the new server or IP address before DNS makes it around to you.

If you’re on a Windows machine, you can try this by adding an entry to the `hosts` file (C:WINDOWS\system32\drivers\etc\hosts by default) on it’s own line:

1.2.3.4     www.yoursite.com

That’s it – now reload your browser and visit www.yoursite.com. It will ignore DNS and resolve as 1.2.3.4 (or whatever you typed in).

Have a happy new year everyone!

2 Responses to “Test DNS Transfer with Windows Hosts File”

  1. TEST DNS TRANSFER WITH WINDOWS HOSTS FILE | DRAKZ FREE ONLINE SERVICE Says:

    [...] rest is here: Test DNS Transfer with Windows Hosts File Share and [...]

  2. NANNYCAMS Says:

    This is a good tip.

    I remember using this back in the day to stop advertising too.

    127.0.0.1 http://www.advertising.com
    127.0.0.1 http://www.annoying-adserver.net

    When one visits a web page it resolved the add to the local host so it never loads in the brower.

    It works with windows as long as the list is not that big. But today there are hundreds and thousands of advertisers. Still useful for stopping the most annoying ads for sure.

Leave a Reply


Intavant          Servermind

©2020 Gabriel Harper. Do not use, copy or re-publish any part of this blog.