h1

Annoying hostfile quirk – 9 entries per line

June 24, 2009

Wasted some time yesterday trying to connect to a local VM website. Turns out that the problem was that you cannot have more than 9 hostfile entries per line so for example:

127.0.0.1 host1 host2 host3 host4 host5 host6 host7 host8 host9 host10

hosts 1-9 will work and resolve correctly but host10 will be be ignored. It will then it will try and resolve by DNS and fail.

My advice FWIW is keep your hostfiles with one entry per line:

102.54.94.97 rhino.acme.com # source server
38.25.63.10 x.acme.com # x client host

Just as it says in the (oft seen but ignored) comments at the top of the hosts file:

Each entry should be kept on an individual line

Leave a Comment