From owner-freebsd-questions@FreeBSD.ORG Wed Mar 27 17:02:39 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 9425ACAA for ; Wed, 27 Mar 2013 17:02:39 +0000 (UTC) (envelope-from freebsd-questions@m.gmane.org) Received: from plane.gmane.org (plane.gmane.org [80.91.229.3]) by mx1.freebsd.org (Postfix) with ESMTP id 54CE5E2D for ; Wed, 27 Mar 2013 17:02:39 +0000 (UTC) Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UKtkZ-0001pH-Ob for freebsd-questions@freebsd.org; Wed, 27 Mar 2013 18:02:59 +0100 Received: from cpc3-walt15-2-0-cust148.13-2.cable.virginmedia.com ([86.21.186.149]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 27 Mar 2013 18:02:59 +0100 Received: from walterhurry by cpc3-walt15-2-0-cust148.13-2.cable.virginmedia.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 27 Mar 2013 18:02:59 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-questions@freebsd.org From: Walter Hurry Subject: Re: line lengths in /etc/hosts Date: Wed, 27 Mar 2013 17:02:21 +0000 (UTC) Lines: 43 Message-ID: References: <5152b48c.U+MyuQ85COeWB4wW%perryh@pluto.rain.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: cpc3-walt15-2-0-cust148.13-2.cable.virginmedia.com User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508 git://git.gnome.org/pan2) 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 17:02:39 -0000 On Wed, 27 Mar 2013 01:57:48 -0700, 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 :) $ tail -20 /etc/hosts 127.0.0.1 r1.zedo.com 127.0.0.1 simg.zedo.com 127.0.0.1 ss1.zedo.com 127.0.0.1 ss2.zedo.com 127.0.0.1 ss7.zedo.com 127.0.0.1 xads.zedo.com 127.0.0.1 yads.zedo.com 127.0.0.1 www.zedo.com #[Adware.RaxSearch] 127.0.0.1 c1.zxxds.net #[g1.panthercdn.com] 127.0.0.1 c7.zxxds.net # [Zero Lag][AS20093][67.201.0.0 - 67.201.63.255] 127.0.0.1 ads.namiflow.com 127.0.0.1 adunit.namiflow.com # [Zero Lag][AS20093][68.71.240.0 - 68.71.255.255] 127.0.0.1 rt.udmserve.net # [Zero Lag][AS20093][72.37.216.0 - 72.37.217.255] 127.0.0.1 www.stickylogic.com 127.0.0.1 www.winadiscount.com #[Dr.Web.Adware.Xbarre] 127.0.0.1 www.winaproduct.com # [end of entries generated by MVPS HOSTS] $