From owner-freebsd-questions@FreeBSD.ORG Wed Mar 27 09:31:34 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7CB06496 for ; Wed, 27 Mar 2013 09:31:34 +0000 (UTC) (envelope-from erichsfreebsdlist@alogt.com) Received: from alogt.com (alogt.com [69.36.191.58]) by mx1.freebsd.org (Postfix) with ESMTP id 4D613760 for ; Wed, 27 Mar 2013 09:31:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=alogt.com; s=default; h=Content-Transfer-Encoding:Content-Type:Mime-Version:References:In-Reply-To:Message-ID:Subject:Cc:To:From:Date; bh=1Ls4+FnAxVzXhlu3AeYg2V/KL95ts8kXDLNaUJiI2R4=; b=gEYxi2omR6r+PEUJ87fvKOPG7DClMpTgQ7f9ZtoQ79qTonQFqodzBN+Gyrx01gjT7mMR8prFQJnNPAXOBr3OacS1eEYsndH1mxCuPs8E5xcTofXC+oLCk1yjZdpsokcBzXFZnb4E4AabcGcnpwDdnqoEN3Lg6htjEuWpJu3NslU=; Received: from [122.129.203.50] (port=33479 helo=X220.ovitrap.com) by sl-508-2.slc.westdc.net with esmtpsa (SSLv3:DHE-RSA-AES128-SHA:128) (Exim 4.80) (envelope-from ) id 1UKmhZ-0049C6-Bi; Wed, 27 Mar 2013 03:31:26 -0600 Date: Wed, 27 Mar 2013 16:31:20 +0700 From: Erich Dollansky To: Erik =?UTF-8?B?TsO4cmdhYXJk?= Subject: Re: line lengths in /etc/hosts Message-ID: <20130327163120.6877eeee@X220.ovitrap.com> In-Reply-To: References: <5152b48c.U+MyuQ85COeWB4wW%perryh@pluto.rain.com> X-Mailer: Claws Mail 3.9.0 (GTK+ 2.24.6; amd64-portbld-freebsd10.0) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - sl-508-2.slc.westdc.net X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - alogt.com X-Get-Message-Sender-Via: sl-508-2.slc.westdc.net: authenticated_id: erichsfreebsdlist@alogt.com X-Source: X-Source-Args: X-Source-Dir: Cc: Perry Hutchison , "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:31:34 -0000 Hi, On Wed, 27 Mar 2013 10:09:29 +0100 Erik N=C3=B8rgaard 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