Date: Wed, 27 Mar 2013 10:09:29 +0100 From: =?utf-8?Q?Erik_N=C3=B8rgaard?= <norgaard@locolomo.org> To: Perry Hutchison <perryh@pluto.rain.com> Cc: "freebsd-questions@freebsd.org" <freebsd-questions@freebsd.org> Subject: Re: line lengths in /etc/hosts Message-ID: <ED2CBF8D-7910-4121-8B16-D1D30C2165E2@locolomo.org> In-Reply-To: <5152b48c.U%2BMyuQ85COeWB4wW%perryh@pluto.rain.com> References: <5152b48c.U%2BMyuQ85COeWB4wW%perryh@pluto.rain.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 27 Mar 2013, at 09:57, perryh@pluto.rain.com (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 :) AFAIK you can have multiple lines. BR
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ED2CBF8D-7910-4121-8B16-D1D30C2165E2>