A Windows XP help forum. PCbanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » PCbanter forum » Microsoft Windows XP » General XP issues or comments
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Can Wildcards be used in the HOSTS file?



 
 
Thread Tools Display Modes
  #1  
Old February 20th 17, 05:43 AM posted to microsoft.public.windowsxp.general
No_Name
external usenet poster
 
Posts: 1
Default Can Wildcards be used in the HOSTS file?

Can Wildcards be used in the HOSTS file?

For example
Instead of putting in all five of these:

www.spam.com
www.spam.com/spammer1
www.spam.com/spammer2
www.spam.com/spammer3
www.spam.com/spammer4

Can someone just put:

www.spam.com/*.*


Ads
  #2  
Old February 20th 17, 08:58 AM posted to microsoft.public.windowsxp.general
R.Wieser
external usenet poster
 
Posts: 1,302
Default Can Wildcards be used in the HOSTS file?

Bret,

The HOSTS file only accepts/works with/filters on *domain names* (the name
of the server). From your examples only the first entry is therefore
valid, the others are not.

Furthermore, if you put that first entry into your HOSTS file (followed by a
127.0.0.1 (or alike) ofcourse) than you catch *everything* attempt to access
that server, no matter what the path to the resource is.

And yes, that means that if you by accident do like "spammer10" than you
would be out of luck, as its an all-or-nothing kind of filtering.

Regards,
Rudy Wieser


-- Origional message:
schreef in berichtnieuws
...
Can Wildcards be used in the HOSTS file?

For example
Instead of putting in all five of these:

www.spam.com
www.spam.com/spammer1
www.spam.com/spammer2
www.spam.com/spammer3
www.spam.com/spammer4

Can someone just put:

www.spam.com/*.*




  #3  
Old February 20th 17, 11:27 AM posted to microsoft.public.windowsxp.general
Micky
external usenet poster
 
Posts: 1,528
Default Can Wildcards be used in the HOSTS file?

In microsoft.public.windowsxp.general, on Mon, 20 Feb 2017 09:58:40
+0100, "R.Wieser" wrote:

Bret,

The HOSTS file only accepts/works with/filters on *domain names* (the name
of the server). From your examples only the first entry is therefore
valid, the others are not.

Furthermore, if you put that first entry into your HOSTS file (followed by a
127.0.0.1 (or alike) ofcourse) than you catch *everything* attempt to access
that server, no matter what the path to the resource is.

And yes, that means that if you by accident do like "spammer10" than you


I've found that spamme10 sends the best spam.

would be out of luck, as its an all-or-nothing kind of filtering.

Regards,
Rudy Wieser


-- Origional message:
schreef in berichtnieuws
...
Can Wildcards be used in the HOSTS file?

For example
Instead of putting in all five of these:

www.spam.com
www.spam.com/spammer1
www.spam.com/spammer2
www.spam.com/spammer3
www.spam.com/spammer4

Can someone just put:

www.spam.com/*.*




  #4  
Old February 20th 17, 03:03 PM posted to microsoft.public.windowsxp.general
Martim Ribeiro
external usenet poster
 
Posts: 8
Default Can Wildcards be used in the HOSTS file?

On Sun, 19 Feb 2017 23:43:10 -0600, in microsoft.public.windowsxp.general
wrote:

Can Wildcards be used in the HOSTS file?


You have the answer.

Another way of answering it from the side is to use the MVP HOSTS file.
http://winhelp2002.mvps.org/hosts.htm

Here is the file.
http://winhelp2002.mvps.org/hosts.txt

Yet another way to do what you want to do is to use Acrylic.
http://superuser.com/questions/13559...ows-hosts-file

Here is Acrylic.
http://mayakron.altervista.org/wikib...id=AcrylicHome

There's also DNSAgent apparently.
https://github.com/stackia/DNSAgent
  #5  
Old February 20th 17, 09:19 PM posted to microsoft.public.windowsxp.general
VanguardLH[_2_]
external usenet poster
 
Posts: 10,881
Default Can Wildcards be used in the HOSTS file?

bret pedro wrote:

Can Wildcards be used in the HOSTS file?

For example
Instead of putting in all five of these:

www.spam.com
www.spam.com/spammer1
www.spam.com/spammer2
www.spam.com/spammer3
www.spam.com/spammer4

Can someone just put:

www.spam.com/*.*


No. Hostnames (optionally with domains) must be listed. Most users
employ the hosts file to define hosts and include the domain although
the domain is only needed if the host is elsewhere (other domain). You
will need 3rd party software that provides URL filtering and which
permits wildcard masking.

In your example, and provided you completed the definition (you forgot
the IP address to which the host reference will get redirected),
www.spam.com/*.* is meaningless. You would filter on www.spam.com, not
on some [sub]path under that domain and definitely not by using a mask
akin to a filespec. It is a *hosts* file. You would add:

127.0.0.0 www.spam.com

in your hosts file. However, that only helps to block DNS requests so
is only useful in a web-centric client that might connect to that
source. The hosts file is not applicable to e-mailed spam since you
were not the receiving e-mail server that accepted the message. The
hosts file will not help to eliminate e-mailed spam whether you use a
local e-mail client or your e-mail provider's webmail client. You were
not the endpoint in the transmission. The e-mail server was.

For most users, the hosts file only has value in blocking unwanted
content in a web client, like a web browser. However, you must specify
hostnames, not domain names. www.spam.com will work but spam.com will
not. That is why pre-compiled hosts files, like the MVPS one, have
around 52 entries just for doubleclick.com, one for each host the domain
uses to issue their content. Entering doubleclick.com in your hosts
file will not block web content originating from rd1.doubleclick.com.
If you want to block on domains (instead of hosts which is what the
hosts file does) then you need to add something that provides URL
filtering.

I use Avast free and it has a URL filter. Alas, Avast has swayed on
that featu in some versions it is there, in other versions it is
missing. So I cannot rely on it being available in every future version
of Avast. Guess they don't consider URL filtering as anti-security or
anti-privacy protection. I also use OpenDNS (with Google DNS as a
backup) instead of my ISP's DNS server. I have an account at OpenDNS
(you can still get a free one but, I believe, you now have to do a trial
of their service, decided not to use them, and they convert you to a
free account as a reward for trying their service, so getting a free
account there now is a bit obtuse). In my OpenDNS free account, I can
define up to 50 URL filters. I can specify a domain, a particular host
at the domain, and even wildcard either the host or domain portion of
the URL filter. This is domain URL filtering. You don't specify some
[sub]path under there. Using OpenDNS with an account means you have to
keep it updated with whatever is your current IP address. That allows
them to know which account, if any, to apply its settings when you
connect to them to issue your DNS lookups. If you have a static IP
address assigned to you by your ISP (usually at extra cost since it may
require getting a business-tier account) then you can configure your
OpenDNS account with that IP address. If you get a dynamically assigned
IP address from your ISP then you need to use a DNS updater client which
reports a change of your IP address into your OpenDNS account. The
updater will also update at 28-day intervals since free accounts will
expire if not updated in a month. Another benefit of using OpenDNS is
that you can assign a hostname to your own computer without having to
register a domain (although you can bring one to OpenDNS if you want to
use that) or have to get someone to home your domain in their
nameserver. Instead of having to remember your IP address (which can
change if dynamic), you can remember its name. OpenDNS also provided
DDNS (Dynamic DNS) services. As I recall, the limit is 2 hostnames per
free account (used to be 5 but they reduced their services for free
accounts). OpenDNS is not the only DNS filtering or DDNS provider.
No-IP is another. There are more.

I know users that configure their DDNS setting in their router to use
OpenDNS or another DDNS provider. The problem there is that the router
only updates the account when its WAN-side IP address changes, and that
could be a lot longer than a month's expiration on free account (even
for dynamic IP address since non-dialup users often keep their IP
address assignment for months). Router-based DDNS support works with
static IP addresses. If you have a dynamic IP address assignment,
you'll want a DNS updater client running on one of your intranet hosts
to update your free account before it expires from being idle too long.
Issuing DNS lookups to your account does not count as accessing your
account. You must login using a local client (DNS updater) or use their
web site. Loggin in is what measures how long your account has been
idle.

Note that DNS filtering in the hosts file, URL filtering, or DNS
filtering only works when you issue DNS lookups, like a reference to
www.spam.com. None of this works if the reference is to an IP address
because that means DNS was never involved. DNS is to lookup a host to
find its IP address. If you start with an IP address, you don't have to
look it up. www.spam.com = 34.198.59.158 and 52.54.255.92. If a
reference uses those IP addresses, none of the above methods will filter
out that source. You retrieving e-mail does not involve DNS (other than
for your local e-mail client to connect to your e-mail provider's server
to get your e-mail). The content of the e-mail is sent to you within a
DATA command in a session between your e-mail client and the server.
There is no DNS lookup involved in the transfer of the e-mail's content.
So putting www.spam.com in a hosts file, URL filter, or using a DDNS
account will not stop you from getting their spam. They will, however,
eliminate that e-mail spam that you do receive from connecting out to
their images or ads via hyperlinks inside their spam message. You still
get the spam but it cannot connect out to retrieve their additional
content. So you end up getting neutered spam.
  #6  
Old February 21st 17, 04:18 PM posted to microsoft.public.windowsxp.general
Shadow
external usenet poster
 
Posts: 1,638
Default Can Wildcards be used in the HOSTS file?

On Sun, 19 Feb 2017 23:43:10 -0600, wrote:

Can Wildcards be used in the HOSTS file?

For example
Instead of putting in all five of these:

www.spam.com

127.0.0.1 www.spam.com

would block access to

www.spam.com/spammer1
www.spam.com/spammer2
www.spam.com/spammer3
www.spam.com/spammer4


and
www.spam.com/*.*


But not

www.hi_there_I_have_cheap_viagra.spam.com

HTH
[]'s
--
Don't be evil - Google 2004
We have a new policy - Google 2012
  #7  
Old February 24th 17, 07:26 AM posted to microsoft.public.windowsxp.general
J. P. Gilliver (John)[_4_]
external usenet poster
 
Posts: 2,679
Default Can Wildcards be used in the HOSTS file?

In message , Shadow
writes:
On Sun, 19 Feb 2017 23:43:10 -0600, wrote:

Can Wildcards be used in the HOSTS file?

For example
Instead of putting in all five of these:

www.spam.com

127.0.0.1 www.spam.com

would block access to

www.spam.com/spammer1
www.spam.com/spammer2
www.spam.com/spammer3
www.spam.com/spammer4


and
www.spam.com/*.*


But not

www.hi_there_I_have_cheap_viagra.spam.com

HTH
[]'s

I think bret_pedro might have been asking, could you have

127.0.0.0 *.spam.com

or even

127.0.0.0 *spam.com

?
--
J. P. Gilliver. UMRA: 1960/1985 MB++G()AL-IS-Ch++(p)Ar@T+H+Sh0!:`)DNAf

The first banjo solo I played was actually just a series of mistakes. In fact
it was all the mistakes I knew at the time. - Tim Dowling, RT2015/6/20-26
  #8  
Old February 24th 17, 09:51 PM posted to microsoft.public.windowsxp.general
Shadow
external usenet poster
 
Posts: 1,638
Default Can Wildcards be used in the HOSTS file?

On Fri, 24 Feb 2017 07:26:11 +0000, "J. P. Gilliver (John)"
wrote:

In message , Shadow
writes:
On Sun, 19 Feb 2017 23:43:10 -0600, wrote:

Can Wildcards be used in the HOSTS file?

For example
Instead of putting in all five of these:

www.spam.com

127.0.0.1 www.spam.com

would block access to

www.spam.com/spammer1
www.spam.com/spammer2
www.spam.com/spammer3
www.spam.com/spammer4


and
www.spam.com/*.*


But not

www.hi_there_I_have_cheap_viagra.spam.com

HTH
[]'s

I think bret_pedro might have been asking, could you have

127.0.0.0 *.spam.com

or even

127.0.0.0 *spam.com


No. You would need a firewall for that, or proxy software.
Hosts file blocks "hosts", and *.spam.com is not a host.
[]'s
--
Don't be evil - Google 2004
We have a new policy - Google 2012
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off






All times are GMT +1. The time now is 01:34 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 PCbanter.
The comments are property of their posters.