[svlug] Re: virtual domain names inside the LAN

Drew Bertola drew at drewb.com
Wed Aug 28 00:59:41 PDT 2002

On Tue, Aug 27, 2002 at 03:36:51PM -0700, Daevid Vincent wrote:
> After re-reading this, I am still a bit confused. I get what your
> saying, I just don't get why it works like that.
> It seems to me that if people outside my LAN get routed to the right IP
> ( and then Apache handles it from there, how come it isn't
> the case that when Lynx on my Linux box ( makes the
> request, it goes out to the DNS server, doesn't it get returned the same
> IP as everyone else, and therefore shouldn't it go to
> and then Apache handles it again like any other request?
> How and/or Why is the internal request being sent to instead
> of I know I re-iterated what you said to some degree, but
> the key phrase I guess is this, when lynx goes to why
> doesn't Apache handle it again like any other incoming request"
> And I looked at 'man hosts' and see:
>       localhost
>    foo.mydomain.org  foo
>    bar.mydomain.org  bar
>   master.debian.org      master
> www.opensource.org
> So should mine look like:
>		daevid localhost.localdomain localhost
> daevid.com
>	www.marq.org ftp.marq.org marq.org marq
>	www.VRExhibits.com ftp.VRExhibits.com VRExhibits.com
> VRExhibits
>	www.frizbcd.com ftp.frizbcd.com frizbcd.com frizbcd
> ...
> Can I stack the same IP like that or does it have to be on one long
> line?

Why not try and find out.  It's an instant change: once you edit and
save, the effect is immediate.  You can always edit it back.

The answer, though, is yes, you can put them on several lines like so:	foo.drew.net	bar.drew.net	dev.drew.net	nut.drew.net	nad.drew.net

I do this on my workstation when I'm developing a site.  So, if I'm
developing, say, agilent.jpager.com, I'd likely have in my /etc/hosts
file:	agilent.drew.net

NOW!  In apache's httpd.conf file, I have to make sure I've set up the
virtual server section correctly:


# NOTE: I want my dev apache sites to come up when I'm working locally
# on my Laptop or other local boxes, so I can't use  I'll
# use my local IP (though this has to match entries in the
# /etc/hosts file for all fake domains on all boxes trying to access
# this server.

  ServerName agilent.drew.net
  DocumentRoot /home/agilent/jpager/site-doc/
  # Don't need more for this dev-site.

 . (other VirtualHosts)



> And do I need to have all four permutations of each domain (www. ftp.
> .com name)?


> Should the IP be or for all the virtual domains?

See above "NOTE"

+---------------------- T h e C o o p . n e t ----------------------+
| Drew Bertola         Hosting - Colocation      Tel:  408-738-8337 |
| TheCoop.net      Programming - Administration  Mob:  408-887-0426 |
| drew at thecoop.net    Open Source Specialists    http://thecoop.net |

More information about the svlug mailing list