Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Is it possible to make Firefox ignore the Hosts file without closing it down?

580 views
Skip to first unread message

Jack

unread,
Sep 26, 2008, 12:51:44 PM9/26/08
to
Sometimes, an entry in the Hosts file will prevent Firefox from loading certain
content that I want to view. Renaming the Hosts file while Firefox is open only has
an effect if I shut down Firefox and restart it, which is a pain.

Is the there a way to get Firefox to ignore the Hosts file without shutting it
(Firefox) down?

goodwin

unread,
Sep 26, 2008, 8:18:20 PM9/26/08
to
On 09/26/2008 09:51 AM Jack scribbled:

> Sometimes, an entry in the Hosts file will prevent Firefox from loading certain
> content that I want to view.

edit the hosts and remove whatever URL you want to see - its a plain
text file.

Renaming the Hosts file while Firefox is open only has
> an effect if I shut down Firefox and restart it, which is a pain.

and kinda dumb as well

>
> Is the there a way to get Firefox to ignore the Hosts file without shutting it
> (Firefox) down?

Not that I know of - kinda useless to have it if you ain't gonna use it.
IMO

Irwin Greenwald

unread,
Sep 26, 2008, 8:33:14 PM9/26/08
to

Try this:
http://www.abelhadigital.com/2007/06/hostsman-3040-released.html

--
Irwin

Please do not use my email address to make requests for help.
Knowledge Base: http://kb.mozillazine.org/Main_Page

Erik Hahn

unread,
Sep 27, 2008, 10:14:10 AM9/27/08
to
On 2008-09-26, Jack <jack6128atgmaildotcom> wrote:
> Sometimes, an entry in the Hosts file will prevent Firefox from loading certain
> content that I want to view. Renaming the Hosts file while Firefox is open only has
> an effect if I shut down Firefox and restart it, which is a pain.
You could e.g. ping the site you want to get the ip, then enter the ip
directly.

-Erik

--
hackerkey://v4sw5hw2ln3pr5ck0ma2u7LwXm4l7Gi2e2t4b7Ken4/7a16s0r1p-5.62/-6.56g5OR

Tony Mechelynck

unread,
Sep 27, 2008, 10:43:53 AM9/27/08
to

Try turning Firefox offline then online after temporarily renaming the
hosts file (untested).

Rationale: The hosts file is a first-level DNS server. Firefox 1.0 used
to invalidate its DNS cache when going offline then online. Don't know
how the situation has evolved since then though.

Best regards,
Tony.
--
Captain Penny's Law:
You can fool all of the people some of the time, and some of
the people all of the time, but you Can't Fool Mom.

Jack

unread,
Sep 27, 2008, 2:20:59 PM9/27/08
to
Tony Mechelynck wrote:
> On 26/09/08 18:51, Jack wrote:
>> Sometimes, an entry in the Hosts file will prevent Firefox from loading
>> certain content that I want to view. Renaming the Hosts file while
>> Firefox is open only has an effect if I shut down Firefox and restart
>> it, which is a pain.
>>
>> Is the there a way to get Firefox to ignore the Hosts file without
>> shutting it (Firefox) down?
>
> Try turning Firefox offline then online after temporarily renaming the
> hosts file (untested).
>
> Rationale: The hosts file is a first-level DNS server. Firefox 1.0 used
> to invalidate its DNS cache when going offline then online. Don't know
> how the situation has evolved since then though.
>
> Best regards,
> Tony.


It works!

Thanks, Tony!

Peter Potamus the Purple Hippo

unread,
Sep 27, 2008, 2:38:10 PM9/27/08
to
Tony Mechelynck wrote:
> On 26/09/08 18:51, Jack wrote:
>> Sometimes, an entry in the Hosts file will prevent Firefox from loading
>> certain content that I want to view. Renaming the Hosts file while
>> Firefox is open only has an effect if I shut down Firefox and restart
>> it, which is a pain.
>>
>> Is the there a way to get Firefox to ignore the Hosts file without
>> shutting it (Firefox) down?
>
> Try turning Firefox offline then online after temporarily renaming the
> hosts file (untested).
>
> Rationale: The hosts file is a first-level DNS server. Firefox 1.0 used
> to invalidate its DNS cache when going offline then online. Don't know
> how the situation has evolved since then though.
>
> Best regards,
> Tony.

so, thats how that works! Thanks for the tip Tony

--
*IMPORTANT*: Sorry folks, but I cannot provide email
help!!!! Emails to me may become public

Notice: This posting is protected under the Free Speech
Laws, which applies everywhere in the FREE world,
except for some strange reason, not to the mozilla.org
newsgroup servers, where your posting may get you banned.

Peter Potamus & His Magic Flying Balloon:
http://melaman2.com/cartoons/singles/mp3/p-potamus.mp3
http://www.toonopedia.com/potamus.htm

Jack

unread,
Sep 27, 2008, 3:00:38 PM9/27/08
to
Peter Potamus the Purple Hippo wrote:
> Tony Mechelynck wrote:
>> On 26/09/08 18:51, Jack wrote:
>>> Sometimes, an entry in the Hosts file will prevent Firefox from loading
>>> certain content that I want to view. Renaming the Hosts file while
>>> Firefox is open only has an effect if I shut down Firefox and restart
>>> it, which is a pain.
>>>
>>> Is the there a way to get Firefox to ignore the Hosts file without
>>> shutting it (Firefox) down?
>> Try turning Firefox offline then online after temporarily renaming the
>> hosts file (untested).
>>
>> Rationale: The hosts file is a first-level DNS server. Firefox 1.0 used
>> to invalidate its DNS cache when going offline then online. Don't know
>> how the situation has evolved since then though.
>>
>> Best regards,
>> Tony.
>
> so, thats how that works! Thanks for the tip Tony
>

I'm not totally sure yet, but indications are that it is not necessary to toggle
offline/online when renaming the Hosts file beck to "Hosts", but only when renaming
it to something else. Also, clearing the cache may be necessary to make the change
complete, but I am not entirely sure. I will just go along and try when I need to
gain access to material that is being block by Hosts.

Terry R.

unread,
Sep 27, 2008, 4:31:22 PM9/27/08
to
The date and time was 9/26/2008 9:51 AM, and on a whim, Jack pounded out
on the keyboard:

Hi Jack,

Here is a batch file that will rename your HOSTS file and instruct you
to put FF Offline and back Online. Just copy the text below into a
notepad document and save it with a bat extension to use. It is
assuming Windows is on C:. If not, change the drive references in the file.

:: Begin batch file
echo off
echo This will temporarily disable the Hosts file
echo .
echo Set Firefox Offline using File, Work Offline before pressing a key
echo .
pause
rename C:\WINDOWS\system32\drivers\etc\HOSTS HOSTSOFF
echo The HOSTS file is now disabled. Click File, Work Offline before
pressing a key to access HOSTS blocked sites.
pause

echo This will re-enable the Hosts file
echo .
echo Set Firefox to Offline using File, Work Offline before pressing a key
pause
rename C:\WINDOWS\system32\drivers\etc\HOSTSOFF HOSTS
echo .
echo The HOSTS file is now enabled. Click File, Work Offline before
pressing a key
echo .
echo The window will now close
pause
exit
:: End batch file

--
Terry R.
Anti-spam measures are included in my email address.
Delete NOSPAM from the email address after clicking Reply.

Fox on the run

unread,
Sep 27, 2008, 4:15:54 PM9/27/08
to
On Sep 27, 10:14 am, Erik Hahn <erik_h...@replyto.invalid> wrote:
> On 2008-09-26, Jack <jack6128atgmaildotcom> wrote:> Sometimes, an entry in the Hosts file will prevent Firefox from loading certain
> > content that I want to view. Renaming the Hosts file while Firefox is open only has
> > an effect if I shut down Firefox and restart it, which is a pain.
>
> You could e.g. ping the site you want to get the ip, then enter the ip
> directly.
>
>         -Erik
>

That won't work. The host file affects all TCP/IP traffic. Thus the
ping will use the host file to resolve whatever same as FF, IE,
Thunderbird, your IM client, etc. So the ping will return what FF
would see anyhow based on the host file.

JB

Erik Hahn

unread,
Sep 27, 2008, 6:04:14 PM9/27/08
to
On 2008-09-27, Fox on the run <jjrbo...@gmail.com> wrote:
> That won't work. The host file affects all TCP/IP traffic. Thus the
> ping will use the host file to resolve whatever same as FF, IE,
> Thunderbird, your IM client, etc. So the ping will return what FF
> would see anyhow based on the host file.
But you can:
-rename the file
-ping
-rename it back
without restarting Firefox.

--
hackerkey://v4sw5hw2ln3pr5ck0ma2u7LwXm4l7Gi2e2t4b7Ken4/7a16s0r1p-5.62/-6.56g5OR

Fox on the run

unread,
Sep 27, 2008, 6:28:11 PM9/27/08
to
On Sep 27, 6:04 pm, Erik Hahn <erik_h...@replyto.invalid> wrote:
> On 2008-09-27, Fox on the run <jjrbouc...@gmail.com> wrote:> That won't work.  The host file affects all TCP/IP traffic.  Thus the

That didn't make it work for me. I have my router in my hosts file
"router 192.168.x.x".
I navigated to my router using "router". I then navigated away from
it. From the command line I renamed my hosts file and then tried to
ping router. It could not resolve. Went into FF and it was still
able to navigate to "router" even after clearing my cache. In another
instant I could not. Something is being retained somewhere.

I even tried the following:
route delete * (clear the routing table)
arp -d * (clear the arp table)
ipconfig /flushdns (clear the dns entries already resolved)
and then cleared the cache in FF

Still to no avail. In other instances just waiting a few minutes did
the trick even without doing all of the above.

If I right click on my network icon and choose "repair" (windows XP)
it seems to do the trick (yet that basically does what I did at the
command line other than it probably causes FF to go offline I guess
which was suggested earlier as a solution).

JB

Fox on the run

unread,
Sep 27, 2008, 7:01:14 PM9/27/08
to

Further to the above, I was testing something different than what you
are testing. You are correct in what you stated about being able to
ping the domain to get the IP (after you renamed the host file to
ensure it didn't get used by ping to resolve anything) and then
dropping that IP in the address bar. But there must be an easier way
to clear the DNS and cache from FF rather than having to get a domain
name's IP and using that to navigate to it.

JB

Erik Hahn

unread,
Sep 27, 2008, 7:11:17 PM9/27/08
to
On 2008-09-27, Fox on the run <jjrbo...@gmail.com> wrote:
> That didn't make it work for me. I have my router in my hosts file
> "router 192.168.x.x".
> I navigated to my router using "router". I then navigated away from
> it. From the command line I renamed my hosts file and then tried to
> ping router. It could not resolve. Went into FF and it was still
> able to navigate to "router" even after clearing my cache. In another
> instant I could not. Something is being retained somewhere.
You missunderstand. Ping tells you the IP of the host you pinged (at
least Linux ping does but I'm pretty sure the Windows version does it
too). You can enter that IP manually in the location bar.

-Erik

--
hackerkey://v4sw5hw2ln3pr5ck0ma2u7LwXm4l7Gi2e2t4b7Ken4/7a16s0r1p-5.62/-6.56g5OR

Fox on the run

unread,
Sep 27, 2008, 8:10:16 PM9/27/08
to
On Sep 27, 7:11 pm, Erik Hahn <erik_h...@replyto.invalid> wrote:
> On 2008-09-27, Fox on the run <jjrbouc...@gmail.com> wrote:> That didn't make it work for me.  I have my router in my hosts file

Yes, I misunderstood (see my posting shortly after the one above to
which you replied). I understand very well what ping does and when
one might use it. Misunderstood what you were suggesting vs what the
OP was trying to accomplish.

JB

Jack

unread,
Sep 27, 2008, 10:19:25 PM9/27/08
to

Thanks Terry,

I'm using this one at present:

@echo off
cls
goto toggleRename
:toggleRename
If Not %winbootdir%'==' Set HostsOff=%windir%\NOHOSTS
If %OS%'==Windows_NT' Set HostsOff=%SystemRoot%\system32\drivers\etc\NOHOSTS
If %HostsOff%'==' goto noIdeaOfOS

If Not %winbootdir%'==' Set HostsOn=%windir%\HOSTS
If %OS%'==Windows_NT' Set HostsOn=%SystemRoot%\system32\drivers\etc\HOSTS
If %HostsOn%'==' goto noIdeaOfOS

If Not Exist %HostsOff% goto deActivate
goto Activate
goto end

:deActivate
color 4F
if not exist %HostsOn% goto noHostsFile
ren %HostsOn% NOHOSTS
echo.
echo ммммммммммммммммммммммммммммммммммммммммммммммммм
echo н кФФФПо
echo н HOSTS FILE BLOCKING IS NOW DE-ACTIVATED Г X Го
echo н РФФФйо
echo. ппппппппппппппппппппппппппппппппппппппппппппппппп
echo.
echo. Advertising will be visible; Parasite protection off!
echo Renamed from HOSTS to NOHOSTS
echo.
goto end

:Activate
color 1F
if not exist %HostsOff% goto noHostsFile
ren %HostsOff% HOSTS
echo.
echo ммммммммммммммммммммммммммммммммммммммммммммммммм
echo н кФФФПо
echo н HOSTS FILE BLOCKING IS NOW ACTIVATED Г ћ Го
echo н РФФФйо
echo. ппппппппппппппппппппппппппппппппппппппппппппппппп
echo.
echo. Advertising will be hidden; Parasite protection on!
echo Renamed from NOHOSTS to HOSTS
echo.
goto end

:noIdeaOfOS
echo Sorry Unsupported OS.
goto end

:noHostsFile
cls
echo.
echo ммммммммммммммммммммммммммммммммммммммммммммммммм
echo н кФФФПо
echo н ERROR NO HOST FILES FOUND ! Г ! Го
echo н РФФФйо
echo. ппппппппппппппппппппппппппппппппппппппппппппппппп
echo .
echo Couldn't find "HOSTS" or "NOHOSTS" in the folder
echo.
echo please check that the HOSTS file is in this folder
echo thanks..
:end
set HostsOff=
set HostsOn=
pause
exit

Lon Stowell

unread,
Sep 28, 2008, 6:54:11 PM9/28/08
to
Erik Hahn wrote:
> On 2008-09-27, Fox on the run <jjrbo...@gmail.com> wrote:
>> That won't work. The host file affects all TCP/IP traffic. Thus the
>> ping will use the host file to resolve whatever same as FF, IE,
>> Thunderbird, your IM client, etc. So the ping will return what FF
>> would see anyhow based on the host file.
> But you can:
> -rename the file
> -ping
> -rename it back
> without restarting Firefox.
>
... after you flush your DNS cache, it might work.

Fox on the run

unread,
Sep 28, 2008, 9:32:04 PM9/28/08
to
On Sep 28, 6:54 pm, Lon Stowell <lon.stow...@comcast.net> wrote:
> Erik Hahn wrote:
> > On 2008-09-27, Fox on the run <jjrbouc...@gmail.com> wrote:
> >> That won't work.  The host file affects all TCP/IP traffic.  Thus the
> >> ping will use the host file to resolve whatever same as FF, IE,
> >> Thunderbird, your IM client, etc.  So the ping will return what FF
> >> would see anyhow based on the host file.
> > But you can:
> >    -rename the file
> >    -ping
> >    -rename it back
> > without restarting Firefox.
>
> ... after you flush your DNS cache, it might work.

Note my earlier post when I used ipconfig/flusdns along with flushing
the routing table and the arp table but that didn't help either.

JB

0 new messages