Entry in /etc/hosts not used

Roger Merritt mcrogerm at stjohn.ac.th
Thu Jun 12 01:41:06 PDT 2003

I've been trying to install a Content Management System for evaluation 
purposes. The system needs to have some virtual domains set up and the docs 
recommend putting the dummy addresses in the /etc/hosts file. That's fine 
by me, because I use /etc/hosts for all the DNS queries for machines on my 
LAN, but I had not realized a single IP address could resolve to more than 
one name. The entries in /etc/hosts are:     editor.imp.ac.th        editor     www.imp.ac.th           www     admin.imp.ac.th         admin     su.imp.ac.th            su

My resolv.conf file is:

domain  imp.ac.th

My host.conf file is:

# $FreeBSD: src/etc/host.conf,v 1.6 1999/08/27 23:23:41 peter Exp $
# First try the /etc/hosts file
# Now try the nameserver next.
# If you have YP/NIS configured, uncomment the next line
# nis

At this point, I'm baffled. Apache is running on the machine that acts as 
the server for the office lan as well as the gateway to the internet. I 
have two NIC's, ed0 set as 203.151.134.xxx, and ed1 set as

If I set all four names to the IP address 203.151.134.xxx, I'm able to ping 
three of them from machines on my LAN, but not editor.imp.ac.th. When I set 
the four names to the IP address, I'm not able to ping any of 
them from the LAN. When I changed the entries in /etc/hosts back to, I'm still able to ping admin, www, and su, but ping shows 
their addresses as still being 203.151.134.xxx!

When I point my browser (Mozilla, 1.3.1) at www, admin, or su.imp.ac.th, it 
displays the root document from the Content Management System I'm trying to 
configure, but it gives me an error message, "editor.imp.ac.th could not be 
found, please check and try again".

I'm baffled and haven't been able to find anything from Google searches. I 
don't understand why the name editor.imp.ac.th is being treated differently 
from the other three, and I don't understand why I can ping the interface 
*not* in my LAN but not the interface that directly connects with the 
machines in my LAN.

Can anyone suggest what to try next? Oh -- it's essential I be able to 
connect my browser to editor.imp.ac.th, because that's the only way to log 
in to the CMS.


More information about the freebsd-questions mailing list