Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Mar 2013 01:57:48 -0700
From: (Perry Hutchison)
Subject:   line lengths in /etc/hosts
Message-ID:  <>

Next in thread | Raw E-Mail | Index | Archive | Help
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:	localhost ...

My version of that line has gotten rather long :)

Want to link to this message? Use this URL: <>