DNS Redirecting to a specific URL

Hello,

We have a DNS server working fine with aliases and so on...

The question is how do we to remap an internal adresse looking like outside.myserver.int (assuming that our server DNS is myserver.int.) to a specific url like * http://www.serverx.com/folder/file* ?
We try alias and srv (but dont understand how it works)...

Thank You

MacPro Quad Core, Mac OS X (10.5.6), Server

Posted on Apr 15, 2009 7:42 AM

Reply
6 replies

Apr 15, 2009 11:32 PM in response to mathieuc

It's in the GUI,or just a html file ?


You can do it in either the Server Admin GUI:

Server Admin -> (server) -> Web -> Sites -> (site) -> Aliases

Add a new URL Alias and choose 'Redirect'. Set .* as the pattern and the URL as the path.

Or you can add the line directly to your site's .conf file (typically somewhere in /etc/apache2/sites/)

Apr 15, 2009 8:17 AM in response to mathieuc

How is the traffic getting from public.example.com to the private.example.net host? Probably with the use of NAT and port-forwarding, as the DNS implies this site is not using public static IP and public DNS throughout the configuration; that there is private DNS and private IP addresses.

If so, then use Server Admin to map the incoming public.example.com requests to the directory location where the files for that (virtual) server are to be located.

Server private.example.net on your LAN will happily receive messages destined for public.example.com and (because the Apache server knows the name of the target from the data within the http traffic) maps these to whatever directory is associated with public.example.com.

That private.example.net is the host server involved here is not visible to the remote web browser, based on the NAT and port forwarding and based on the virtual hosting capabilities of Apache.

There's no central requirement to involve your LAN DNS in this http traffic, given port forwarding from the network firewall. (Though you could choose to port forward to the internal DNS name, if you chose.) That the target host name is embedded within the http traffic is the key here.

If that's not what you're after, can you describe your network configuration and your goals here in somewhat more detail?

Apr 15, 2009 10:36 AM in response to MrHoffman

simple : client have 2 DNS primary= our server / secondary = isp one's
Just want when typing a simple URL outside.myserver.com goes to www.somewhereelse/directory/file.
myserver.com is controled by our DNS.

maybe creating an simple alias in our dns and then in the Web service creating a redirection ?
Do we have to write a specific index.htm file or can we put the specific url inside the Web service ?

Apr 15, 2009 11:58 AM in response to mathieuc

You're focused on DNS, and (from what I'm reading) that's not even necessarily involved nor even necessarily required here.

Can you describe:

your specific network addressing configuration...

... your rough organization from the network modem inwards...

... and your particular problem requirements here?

in greater detail?

In particular, do you have a firewall?

... and do you have NAT and port forwarding enabled there?

Please hold off on describing the proposed DNS-based solution for now. At least until the problem is entirely clear (to me), that is.

Apr 15, 2009 2:28 PM in response to mathieuc

Your question has nothing to do with DNS.

DNS cannot ever map to a URL. All it can ever do is map a hostname to an IP address (or vice versa).

For example, your DNS server can map (via a CNAME) 'outside.myserver.int' to 'www.serverx.com' but it cannot add the protocol ( http://) nor can it add the path (/folder/file)

What you're asking for needs to be done in your web server, not your DNS server.

Your web server needs to detect requests from clients trying to access 'outside.myserver.int' and generate the appropriate redirects.

Assuming your web server is running Mac OS X Server this can be done by just creating a new Site for outside.myserver.int and adding an alias:

Alias .* http://www.serverx.com/folder/file


Now whenever it sees a request for outside.myserver.int it will redirect the user to the appropriate place.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

DNS Redirecting to a specific URL

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.