[clug] FW: DNS CNAME rewriting?
robert at apex.net.au
Sat Nov 12 06:29:52 GMT 2005
If Ive understood you correctly, the people viewing the web pages have a
view of DNS that includes the www.example.com.au domain.
But the hosting servers view of DNS doesnt include the au domain.
In theory that shouldnt matter.
The way name based virtual hosting works is that the client resolves the
name to an IP. And sends a request to that IP including the actual name
in a http header.
When the server gets a request, it looks at the name in the header and
compares it to its config and passes out the matching page.
At that stage its got nothing to do with DNS.
So in theory at least, you should be able to configure a web server to
hand back answers to requests for hosts that arent in the DNS.
And as long as the client web browser was able to map www.example.com.au
to the correct IP, the request should go to the right place. And should
So the only place the DNS needs to work is where the client is.
Of course, if that doesnt work, or you can't get the au virtual host
programmed into the outsourced web server for some reason then about
your best option is to relay the requests via your own web server. Look
into the apache proxy module. That allows you to transparently redirect
web requests to an arbitrary server.
John Fletcher wrote:
> I have a slight problem - I need to kind of rewrite or redirect DNS
> When a web browser requests a page, it obtains the address of the server
> and then requests from it the desired page, telling it it's full name
> including server.
> Lets say I have DNS records www.example.com, www1.example.com and
> www2.example.com, all CNAMEs pointing to webserver.example.com. As we
> know, once on webserver.example.com, apache inspects the hostname and
> directs the request to the virtual host www, www1 or www2. This all
> presently works very nicely.
> We also have www.example.com.au, www1.example.com.au and
> www2.example.com.au configured as virtual hosts pointing to the same
> respective pages on webserver.example.com. All working.
> Now the problem: We are outsourcing our webserver and pointing
> webserver.example.com to the outsourced server, which then successfully
> resolves the www1.example.com www2.example.com and www3.example.com
> adresses to the correct pages. What I want to do is have requests
> coming into www.example.com.au pointed to webserver.example.com but
> currently the outsourced webserver doesn't recognise the domain
> www.example.com.au, so a CNAME will not work (as the request is still
> supplied to apache as being to the .au domain, which apache doesn't
> understand). Can I organise some kind of DNS redirection to redirect
> www.example.com.au to www.example.com in order to solve this problem or
> does this problem have to be solved via the outsourcing provider?
> Thanks guys.
More information about the linux