Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

In my occupation as a sysadmin, I often find times where I need to "game the system" by editing the host file. Doing so preempts any dns records for a domain name and allows me to make the ip whatever I want for a given hostname. This is extremely useful.

The downside to this is that every time I want to change that same hostname to a different IP, I believe I have to close the browser application before the change will take effect. In situations like chrome where I literally have 50-60 tabs open, this can get rather tedious.

Does anyone know of an alternate way to cause these apps to reload the hosts file?

EDIT -- I am speaking in terms of the Windows family of operating systems, specifically Windows 7 and/or Windows Server 2008R2 .

share|improve this question
    
The behaviour is significantly different across operating systems. State your platform(s) in the question; lest you receive helpfully intended but highly misleading answers. –  JdeBP Nov 7 '11 at 15:06
    
a next best thing is to save all the tabs google.co.uk/support/forum/p/Chrome/… By the way, what is the usefulness in what you call gaming the system? what does it involve? (I know what the hosts file does but just curious what you're using it for) –  barlop Nov 7 '11 at 15:15
    
@barlop presumably this is for testing internal servers before updating DNS. In IIS for example you might setup a host header and want to test it before updating DNS –  chunkyb2002 Nov 7 '11 at 16:36
    
Chunky is right; sometimes you need to test a new server but don't want to change DNS anywhere where someone else might be affected by it. –  Peter Grace Nov 7 '11 at 16:54

2 Answers 2

up vote 4 down vote accepted

When using chrome, you can go to

chrome://net-internals/#dns
and purge the dns resolver cache. As iglvzx mentioned, you can use extensions in firefox to achieve the same function. Unfortunately, it appears that Internet Explorer has no analogous feature at this time.

share|improve this answer
    
This works in chrome, except that the URL has been munged (by the stack exchange software?). Visitors from the future - note that you probably need to type that url in to chrome exactly (colon slash slash included) and that there should be no http. –  Andrew M Jan 12 '12 at 11:00
    
Thanks Andrew, I went to fix the URL but the interface wont let it become a hyperlink without the http; I'll talk to the devs about this but in the meantime it's demoted itself to regular text, so I just put it in code tags to make it a bit easier to follow. –  Peter Grace Jan 12 '12 at 14:24
    
How long would it take Chrome to refresh without doing this? For when instructing people who are not tech savvy enough to follow these instructions. –  Xonatron Nov 13 '12 at 17:19
    
@MatthewDoucette it is my understanding, however unverified, that the dns cache will persist until you fully close Chrome. –  Peter Grace Nov 13 '12 at 18:41

Have you tried any of the add-ons available for Firefox? Try searching for hosts or dns.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.