[CLUE-Tech] simulating DNS function
Nate Duehr
nate at natetech.com
Mon May 10 09:29:25 MDT 2004
Gus S.Calabrese wrote:
>
> I have multiple domains on my webserver and it is working fine.
>
> My question is to whether there is a way to directly access a particular
> domain on my server without using a DNS server.
No.
You can change your /etc/hosts file on your local machine you're using
to hit the server with so it'll report different names to the webserver
when you connect... that's one workaround...
Something like :
192.168.10.1 name1.virtualhost.net
# 192.168.10.1 name2.virtualhost.net
# 192.168.10.1 name3.virtualhost.net
And just uncomment the one you want to test and then type the name into
your browser, and when you need to switch, comment out the other one --
this will work if all you have is name-based virtual hosting on your
Apache machine.
Another common tactic if your webservers have a connection to both an
external and an internal network is to assign both name-based virtuals
and multiple internal IP addresses to the different named virtuals on
the Apache machine so you can "hit" each site from inside only with the
IP addresses from a list you keep. So from outside everyone's hitting
the same IP but different name, and from the inside of your network
you'd hit each virtual host by a different private-side IP.
There's various workarounds... but nothing 100% clean. Add SSL to the
mix and it becomes a complete mess without multiple public IP's because
of the reverse DNS matching requirements of SSL-enabled browsers.
(Unless you like your users seeing SSL error messages or they don't care...)
Hope that gives you some ideas.
Nate Duehr, nate at natetech.com
More information about the clue-tech
mailing list