Re: Is there any point to full host names in /etc/hosts ?
- From: David Brown <david.brown@xxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 05 Nov 2007 22:12:52 +0100
Moe Trin wrote:
On Sun, 04 Nov 2007, in the Usenet newsgroup comp.os.linux.networking, in
article <472de7fd$0$3510$8404b019@xxxxxxxxxxxxxxx>, David Brown wrote:
Moe Trin wrote:
Minor quibble - a given hostname OR IP address should appear on one
line only.
If you are using the hosts file to avoid web advertisements or other sites you want to avoid, the hosts file generally contains a long list of "127.0.0.1 ads.doubleclick.net" lines, with every line resolving to the same IP address. Is there some problem with lists like that?
Generally that technique slows things down. In theory, you can list
multiple host _names_ on each line (and the lines can be long), but
_any_ IP address in the range 127.0.0.0 through 127.255.255.254 resolves
to 'localhost'.
[compton ~]$ ping -qc 1 127.0.0.0
PING 127.0.0.0 (127.0.0.0): 56 data bytes
--- 127.0.0.0 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 0.3/0.3/0.3 ms
[compton ~]$ ping -qc 1 127.2.3.4
PING 127.2.3.4 (127.2.3.4): 56 data bytes
--- 127.2.3.4 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 0.3/0.3/0.3 ms
[compton ~]$ ping -qc 1 127.255.255.254
PING 127.255.255.254 (127.255.255.254): 56 data bytes
--- 127.255.255.254 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 0.3/0.3/0.3 ms
[compton ~]$
so you could put 4,294,967,295 lines in there. Might take a bit of
extra RAM on your part, and would slow your browsing to a crawl, but
it's possible. (Running your own DNS would probably be quicker.)
Old guy
I have a dnsmasq DNS server for the network, so I'd put the hosts list there for the benefit of all machines. It would not actually be in the system's /etc/hosts file, but a separate file in the same format, loaded by dnsmasq. Readily available host lists on the Internet that I looked at all have a single 127.0.0.1 address, but it would be easy enough to change the lines as you suggest with a little script - but would that make any difference in practice? And would windows clients on the network follow the rules and work with 127.*.*.* addresses? (brief testing suggests yes, but I value the experience of others).
mvh.,
David
.
- Follow-Ups:
- Re: Is there any point to full host names in /etc/hosts ?
- From: Moe Trin
- Re: Is there any point to full host names in /etc/hosts ?
- References:
- Is there any point to full host names in /etc/hosts ?
- From: Rikishi 42
- Re: Is there any point to full host names in /etc/hosts ?
- From: Moe Trin
- Re: Is there any point to full host names in /etc/hosts ?
- From: David Brown
- Re: Is there any point to full host names in /etc/hosts ?
- From: Moe Trin
- Is there any point to full host names in /etc/hosts ?
- Prev by Date: Re: nat traverse
- Next by Date: Re: Is there any point to full host names in /etc/hosts ?
- Previous by thread: Re: Is there any point to full host names in /etc/hosts ?
- Next by thread: Re: Is there any point to full host names in /etc/hosts ?
- Index(es):
Relevant Pages
|