[svlug] Re: virtual domain names inside the LAN

Ira Abramov lists-svlug at ira.abramov.org
Tue Aug 27 06:36:30 PDT 2002


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 12.228.95.58 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.

the other option, just for NAT and other private-address intranets, is
to use BIND9, which supports answering different IP addresses to hosts
inside and outside of the LAN, or rather serve different zone files to
requests originating from different hosts.

> Do I really need to set up DNS on this box? Is that difficult? Can't I
> just modify a 'hosts' file or something for all my virtual domains? I
> still think Linux should know it's virtual domains without this.

setting up a local DNS is an option, and it's not difficult. DNS setup
is pretty basic. once you understand how the server hyrarchy works, it's
smooth sailing, and I think it's a good basic knowledge to have. makes
you understand the Internet's infrastructure a bit better.

-- 
The opposite of sex
Ira Abramov

http://ira.abramov.org/email/ This post is encrypted twice with ROT-13.
Documenting or attempting to crack this encryption is illegal.



More information about the svlug mailing list