http://mewnlite.com/unable.jpg
There oughta be a way browsers could detect when a site is being blocked by
a hosts file and return a friendlier & much shorter message!
--
-- I'm retired. I was tired yesterday. I'm tired again today --
http://mewnlite.com/unable.jpg
There oughta be a way browsers could detect when a site is being blocked by
a hosts file and return a friendlier & much shorter message!
--
-- I'm retired. I was tired yesterday. I'm tired again today --
From: "Retired" <senile@nursinghome.nat>
> http://mewnlite.com/unable.jpg
> There oughta be a way browsers could detect when a site is being blocked by
> a hosts file and return a friendlier & much shorter message!
>
That's the nature of of using the etc/hosts file in a way that it wasn't intended.
It is real simple - If you don't like it, don't use it.
--
Dave
Multi-AV Scanning Tool - http://multi-av.thespykiller.co.uk
http://www.pctipp.ch/downloads/dl/35905.asp
Retired wrote:
> http://mewnlite.com/unable.jpg
> There oughta be a way browsers could detect when a site is being blocked by
> a hosts file and return a friendlier & much shorter message!
Depends on what Hosts file in which you refer ?
Try this: Note (cannot guarantee results as am not a Moz user)
<http://winhelp2002.mvps.org/hostsfaq.htm#Firefox_only>
Silj
--
"Arguing with anonymous strangers on the Internet is a sucker's game
because they almost always turn out to be -- or to be indistinguishable from
-- self-righteous sixteen-year-olds possessing infinite amounts of free time."
- Neil Stephenson, _Cryptonomicon_
Retired wrote:
> There oughta be a way browsers could detect when a site is being
> blocked by a hosts file and return a friendlier & much shorter
> message!
Well, think about it. What is happening when you use a hosts file? You
are telling your computer to use the IP address that *you* specified to
lookup a hostname that you specified. A DNS lookup is required to
convert a hostname, a text string that humans like to use, to an IP
address, a binary value required by computers to connect to each other.
When doing a DNS lookup, your OS will first do a lookup in the local
hosts file (which equates a hostname to an IP address). Well, what is
your web browser trying to connect to? A web server! So run a web
server at the IP address you specify. If you specify 127.0.0.1 for the
IP address then run a web server at that IP address (i.e., your local
host). You could run a web server on a different one of your intranet
hosts and point your hosts file over there, like running a web server on
your host at 192.168.10.30 and defining the lookups in your hosts file
to use that IP address (192.168.10.30 hn1.doubleclick.net). Your web
browser is trying to connect via HTTP to a web server so give it one at
whatever IP address you use in the hosts file.
At the web server to which you point using the IP address in the hosts
file, deliver a web page that tells you that some content got blocked,
like "<host> access blocked by hosts file". Don't make it too big
because some content might be small images inside a web page that you
are blocking and you want to see your blocking message. Unless you did
a custom install of your *unidentified* operating system, it's like it
included a web server so you already have one installed. Use that one
to deliver your replacement page for the blocked content. One
suggestion is to use an image for the replacement content instead of
text. A web page might have a small area for the content that you want
to block which is resized depending on the window size for the web
browser, and an image lends itself well to resizing.
There is a freeware utility web server used just for this purpose; see
http://www.softpedia.com/get/Interne.../eDexter.shtml.
You installed the product on your computer which was, in effect, a web
server. Since it was running on your own computer, it was listening at
IP address 127.0.0.1. So when your web browser specified a hostname
that matched with one in the hosts file and because your hosts file
pointed at 127.0.0.1, your web browser connected to this local web
server to show its replacement content ("Content blocked"). I never
bothered to look much into that tool since all it did was run a local
web server and most operating systems already include their own.
Whether using eDexter or another web server, and when you want to run
your own real web server on your own host, there'll be problem with
which web server your or other web browsers will connect. You can't
have 2 web servers running at 127.0.0.1 (localhost) and both listening
on the default HTTP port (80). The DNS scheme (whether using a DNS
server or the hosts file) doesn't know about ports. It provides a
lookup from hostname to IP address. That's it. However, if you want to
run your own real web browser that is accessible to others, you can have
it listen on a port other than 80, like 8080. Then in the port
forwarding that you'll need to configure in your router to punch a hole
through its firewall to allow outside access to your host and its web
server, you have it forward connects on port 80 on itself (the router)
to port 8080 on the port to which you forward those connects to your
internal web server host. Router port 80 --> web server host port 8080.
Obviously if you're going to punch a hole through the router's firewall
and run a web server on your internal host then you better be sure to
lockup and secure that internal host on your network. You would use one
web server for the hosts file lookups (your web browser attempts to get
to a hostname on port 80 but the hosts file points to your own web
server listening on port 80 and delivers its replacement content).
Another web server on the same host is listening on a different port
(8080) which you use for external requests from your host (even you can
go out and back into your local host) and you use port forwarding to go
from port 80 on your WAN-side connection (router's upstream side) to
port 8080 for your web server host. (By the way, if you want to run
your own web server and want to identify it by name instead of having to
remember what is the current dynamically assigned IP address for your
router given to it by your ISP, look at DynDNS or No-IP for free dynamic
DNS service).
Alternatively, use some security software that does this for you. Some
security products will let you do URL blocking (rather than use a hosts
file). A disadvantage with the hosts file is that you have to specify a
host, not a domain. You cannot block on .doubleclick.com in a hosts
file. You HAVE to specify the FQDN (fully qualified domain name) and
that includes specifying the host. If you look at the MVPs hosts file,
it has over 50 entries alone for the Doubleclick domain to list the
hostnames for all those that are known for that domain. In a security
product that lets you do URL blocking, you can just specify to block on
..doubleclick.com and .doubleclick.net to cover that domain. The
security product will intercept connects to those domains and, like a
web server, deliver to your web browser a small message as the
replacement content for the blocked content. For example, Avast lets
you do URL blocking and it puts a small message as replacement content.
Note that if your intent is to block others, like your children, from
getting to a web site (versus blocking ads), they can still use an IP
address to get there. The hosts file or other URL blocking works on
hostnames, not on IP addresses. Like DNS, they are returning an IP
address for the hostname you specified. Obviously they aren't involved
if a lookup isn't needed because you specified an IP address. Also
remember that anything you can do on your computer can be undone by
anyone you grant physical access to that computer, even if they don't
have an admin-level account on that computer. If your intent is to
censor what others can see using your computer, do the filtering
upstream at a device to which those users do not have physical access,
like in the router or in a gateway host. If you doing ad-blocking, you
don't need to worry since you don't need to be concerned about how you
are censoring yourself.
Be aware that web sites can determine if you are not downloading all of
their content. If you choose to block some of the content, they can see
that and choose not to provide you with some of their content (i.e.,
deliver to you a limited page) or entirely block delivery of their web
page (after detecting you don't get some of it). In fact, some blocking
can render a page worthless. For example, if you block
"google.com/adsense/" then the page might not paint correctly because
the site is using off-site scripts that come from the other domain.
Most users are using a hosts file that was pre-compiled by someone else,
like the MVPs hosts file, so you can run into problems at some sites
regarding loss of their content.
With a hosts file, you have to manually rename that file to something
else and reload/refresh your web browser to get the web page to display
correctly, then later remember to rename back the hosts file to continue
using it again later. Adding the site to your Trusted Sites list won't
help because you are using the hosts file to redirect the connects to
127.0.0.1 (or whatever IP address you specify; I find 127.0.0.0 works
faster since the computer doesn't waste time trying to find a web
server). It is a manual process (or you could write a batch file to
script the renames) to get the hosts file temporarily out of the way.
With a security product that includes URL blocking, it's usually pretty
simple to quickly disable just its URL blocking.
Retired wrote:
> http://mewnlite.com/unable.jpg
> There oughta be a way browsers could detect when a site is being blocked by
> a hosts file and return a friendlier& much shorter message!
>
This works for SeaMonkey, which uses Firefox as it's browser:
about:config
Set browser.xul.error_pages.enabled to false.
--
JD..
JD <JD@example.invalid> wrote in
news:6vSdnZsl3IoZYjbTnZ2dnUVZ_hydnZ2d@posted.grand ecom:
> Retired wrote:
>> http://mewnlite.com/unable.jpg
>> There oughta be a way browsers could detect when a site is being
>> blocked by a hosts file and return a friendlier& much shorter
>> message!
>>
>
> This works for SeaMonkey, which uses Firefox as it's browser:
>
> about:config
>
> Set browser.xul.error_pages.enabled to false.
You da man! Works like a charm. There's still blank space there but that's
much prettier than all that "unable to connect garbage".
Thank you!
--
-- I'm retired. I was tired yesterday. I'm tired again today --
JD wrote:
> Retired wrote:
>> http://mewnlite.com/unable.jpg
>> There oughta be a way browsers could detect when a site is being
>> blocked by a hosts file and return a friendlier& much shorter
>> message!
>>
>
> This works for SeaMonkey, which uses Firefox as it's browser:
>
> about:config
>
> Set browser.xul.error_pages.enabled to false.
Great reply.
Buffalo
Retired wrote:
> JD<JD@example.invalid> wrote in
> news:6vSdnZsl3IoZYjbTnZ2dnUVZ_hydnZ2d@posted.grand ecom:
>
>> Retired wrote:
>>> http://mewnlite.com/unable.jpg
>>> There oughta be a way browsers could detect when a site is being
>>> blocked by a hosts file and return a friendlier& much shorter
>>> message!
>>>
>>
>> This works for SeaMonkey, which uses Firefox as it's browser:
>>
>> about:config
>>
>> Set browser.xul.error_pages.enabled to false.
>
> You da man! Works like a charm. There's still blank space there but that's
> much prettier than all that "unable to connect garbage".
>
> Thank you!
>
You're welcome! Not my solution but always glad to share what I've
learned from this and other newsgroups. And I really didn't like the
unable to connect garbage. Kind of defeated the purpose of the HOSTS file.
--
JD..
JD <JD@example.invalid> wrote in
news:6vSdnZsl3IoZYjbTnZ2dnUVZ_hydnZ2d@posted.grand ecom:
> Retired wrote:
>> http://mewnlite.com/unable.jpg
>> There oughta be a way browsers could detect when a site is being
>> blocked by a hosts file and return a friendlier& much shorter message!
>>
>
> This works for SeaMonkey, which uses Firefox as it's browser:
>
> about:config
>
> Set browser.xul.error_pages.enabled to false.
>
Nice call JD.
--
I am a sinner
Hold my prayers upto the sun
I am a sinner
Heaven's closed for what I've done.
From: "JD" <JD@example.invalid>
> Retired wrote:
>> JD<JD@example.invalid> wrote in
>> news:6vSdnZsl3IoZYjbTnZ2dnUVZ_hydnZ2d@posted.grand ecom:
>>
>>> Retired wrote:
>>>> http://mewnlite.com/unable.jpg
>>>> There oughta be a way browsers could detect when a site is being
>>>> blocked by a hosts file and return a friendlier& much shorter
>>>> message!
>>>>
>>>
>>> This works for SeaMonkey, which uses Firefox as it's browser:
>>>
>>> about:config
>>>
>>> Set browser.xul.error_pages.enabled to false.
>>
>> You da man! Works like a charm. There's still blank space there but that's
>> much prettier than all that "unable to connect garbage".
>>
>> Thank you!
>>
>
> You're welcome! Not my solution but always glad to share what I've learned from this and
> other newsgroups. And I really didn't like the unable to connect garbage. Kind of
> defeated the purpose of the HOSTS file.
>
Kudos!
--
Dave
Multi-AV Scanning Tool - http://multi-av.thespykiller.co.uk
http://www.pctipp.ch/downloads/dl/35905.asp
There are currently 1 users browsing this thread. (0 members and 1 guests)