Test DNS Transfer with Windows Hosts File
Posted on January 1st, 2010 by Gabriel HarperHere’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!
January 12th, 2010 at 11:02 am
[...] rest is here: Test DNS Transfer with Windows Hosts File Share and [...]
January 12th, 2010 at 4:36 pm
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.