[svlug] Re: virtual domain names inside the LAN
daevid at daevid.com
Tue Aug 27 15:36:51 PDT 2002
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
(126.96.36.199) and then Apache handles it from there, how come it isn't
the case that when Lynx on my Linux box (192.168.0.254) makes the
request, it goes out to the DNS server, doesn't it get returned the same
IP 188.8.131.52 as everyone else, and therefore shouldn't it go to
184.108.40.206 and then Apache handles it again like any other request?
How and/or Why is the internal request being sent to 192.168.0.1 instead
of 220.127.116.11? I know I re-iterated what you said to some degree, but
the key phrase I guess is this, when lynx goes to 18.104.22.168 why
doesn't Apache handle it again like any other incoming request"
And I looked at 'man hosts' and see:
192.168.1.10 foo.mydomain.org foo
192.168.1.13 bar.mydomain.org bar
22.214.171.124 master.debian.org master
So should mine look like:
127.0.0.1 daevid localhost.localdomain localhost
192.168.0.254 www.marq.org ftp.marq.org marq.org marq
192.168.0.254 www.VRExhibits.com ftp.VRExhibits.com VRExhibits.com
192.168.0.254 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
And do I need to have all four permutations of each domain (www. ftp.
Should the IP be 127.0.0.1 or 192.168.0.254 for all the virtual domains?
> -----Original Message-----
> Quoting Daevid Vincent, from the post of Tue, 27 Aug:
> > Shouldn't the linux box know about itself and all it's own virtual
> > domains? I mean, how come if I'm telnetted in, and I "lynx
> > http://www.marq.org" or "lynx http://www.daevid.com" it
> doesn't know
> > that those virtual domains are itself, but rather sends me to the
> > router which is 192.168.0.1. Whereas external people can get there
> > just fine.
> when you tell lynx to open a connection to www.daevid.com it
> looks it up in the hosts file (which is where you want to put
> it as an alias to 127.0.0.1 or your ethX address) and then
> the DNS. since you have nothing in your hosts file, lynx goes
> to 126.96.36.199 which is not an IP address of your machine,
> nor on your default network, so the request is sent out via
> the default router. straight and simple. the machine doesn't
> know its names, it knows where to route IP-addressed packets.
> it is the responsability of the browser, proxy but mainly the
> resolver library to get your request to the right web
> server, and you can't expect lynx to look in the local apache
> config to see if your request should actually remain inside
> the machine and not do the round trip to the NAT router.
> therefore - /etc/hosts hacks.
More information about the svlug