Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Mar 2013 16:31:20 +0700
From:      Erich Dollansky <erichsfreebsdlist@alogt.com>
To:        Erik =?UTF-8?B?TsO4cmdhYXJk?= <norgaard@locolomo.org>
Cc:        Perry Hutchison <perryh@pluto.rain.com>, "freebsd-questions@freebsd.org" <freebsd-questions@freebsd.org>
Subject:   Re: line lengths in /etc/hosts
Message-ID:  <20130327163120.6877eeee@X220.ovitrap.com>
In-Reply-To: <ED2CBF8D-7910-4121-8B16-D1D30C2165E2@locolomo.org>
References:  <5152b48c.U%2BMyuQ85COeWB4wW%perryh@pluto.rain.com> <ED2CBF8D-7910-4121-8B16-D1D30C2165E2@locolomo.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi,

On Wed, 27 Mar 2013 10:09:29 +0100
Erik N=C3=B8rgaard <norgaard@locolomo.org> wrote:

> On 27 Mar 2013, at 09:57, perryh@pluto.rain.com (Perry Hutchison)
> wrote:
>=20
> > Is there a limit on line length in FreeBSD's /etc/hosts?
> >=20
> > 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.
> >=20
> > To answer the inevitable followup "why would anyone need such
> > a long line in /etc/hosts":
> >=20
> > With this line in /etc/nsswitch.conf
> >=20
> >  hosts: files dns
> >=20
> > I can easily suppress access to unwanted web sites by adding
> > names to the localhost line in /etc/hosts, like this:
> >=20
> >  127.0.0.1    localhost localhost.my.domain bad1.com bad2.com ...
> >=20
> > My version of that line has gotten rather long :)
>=20
> AFAIK you can have multiple lines.=20
>=20
yes, I have hundreds or even thousands of lines and never ran into any
problems.

Erich



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130327163120.6877eeee>