line lengths in /etc/hosts
walterhurry at gmail.com
Wed Mar 27 17:02:39 UTC 2013
On Wed, 27 Mar 2013 01:57:48 -0700, Perry Hutchison wrote:
> Is there a limit on line length in FreeBSD's /etc/hosts?
> I'm not finding any mention of such a limit in hosts(5), but characters
> beyond the first 660 or so seem to be ignored.
> To answer the inevitable followup "why would anyone need such a long
> line in /etc/hosts":
> With this line in /etc/nsswitch.conf
> hosts: files dns
> I can easily suppress access to unwanted web sites by adding names to
> the localhost line in /etc/hosts, like this:
> 127.0.0.1 localhost localhost.my.domain bad1.com bad2.com ...
> My version of that line has gotten rather long :)
$ tail -20 /etc/hosts
127.0.0.1 www.zedo.com #[Adware.RaxSearch]
127.0.0.1 c1.zxxds.net #[g1.panthercdn.com]
# [Zero Lag][AS20093][220.127.116.11 - 18.104.22.168]
# [Zero Lag][AS20093][22.214.171.124 - 126.96.36.199]
# [Zero Lag][AS20093][188.8.131.52 - 184.108.40.206]
127.0.0.1 www.winadiscount.com #[Dr.Web.Adware.Xbarre]
# [end of entries generated by MVPS HOSTS]
More information about the freebsd-questions