From owner-freebsd-questions@FreeBSD.ORG Wed Mar 27 09:01:02 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 1740CA9F for ; Wed, 27 Mar 2013 09:01:02 +0000 (UTC) (envelope-from perryh@pluto.rain.com) Received: from agora.rdrop.com (agora.rdrop.com [IPv6:2607:f678:1010::34]) by mx1.freebsd.org (Postfix) with ESMTP id E5F54200 for ; Wed, 27 Mar 2013 09:01:01 +0000 (UTC) Received: from agora.rdrop.com (66@localhost [127.0.0.1]) by agora.rdrop.com (8.13.1/8.12.7) with ESMTP id r2R9108O044408 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Wed, 27 Mar 2013 02:01:00 -0700 (PDT) (envelope-from perryh@pluto.rain.com) Received: (from uucp@localhost) by agora.rdrop.com (8.13.1/8.14.2/Submit) with UUCP id r2R910li044407 for freebsd-questions@freebsd.org; Wed, 27 Mar 2013 02:01:00 -0700 (PDT) (envelope-from perryh@pluto.rain.com) Received: from fbsd81 ([192.168.200.81]) by pluto.rain.com (4.1/SMI-4.1-pluto-M2060407) id AA01423; Wed, 27 Mar 13 01:57:58 PDT Date: Wed, 27 Mar 2013 01:57:48 -0700 From: perryh@pluto.rain.com (Perry Hutchison) To: freebsd-questions@freebsd.org Subject: line lengths in /etc/hosts Message-Id: <5152b48c.U+MyuQ85COeWB4wW%perryh@pluto.rain.com> User-Agent: nail 11.25 7/29/05 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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:01:02 -0000 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 :)