From owner-freebsd-questions@FreeBSD.ORG Wed Mar 27 09:09:43 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id F1A24DB6 for ; Wed, 27 Mar 2013 09:09:43 +0000 (UTC) (envelope-from norgaard@locolomo.org) Received: from mail.locolomo.org (97.pool85-48-194.static.orange.es [85.48.194.97]) by mx1.freebsd.org (Postfix) with ESMTP id AD60B324 for ; Wed, 27 Mar 2013 09:09:43 +0000 (UTC) Received: from [10.9.150.193] (unknown [95.169.240.181]) by mail.locolomo.org (Postfix) with ESMTPSA id 11F3B1C0841; Wed, 27 Mar 2013 10:09:36 +0100 (CET) References: <5152b48c.U+MyuQ85COeWB4wW%perryh@pluto.rain.com> In-Reply-To: <5152b48c.U+MyuQ85COeWB4wW%perryh@pluto.rain.com> Mime-Version: 1.0 (iPhone Mail 8C148) Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii Message-Id: X-Mailer: iPhone Mail (8C148) From: =?utf-8?Q?Erik_N=C3=B8rgaard?= Subject: Re: line lengths in /etc/hosts Date: Wed, 27 Mar 2013 10:09:29 +0100 To: Perry Hutchison Cc: "freebsd-questions@freebsd.org" X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Mar 2013 09:09:44 -0000 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