Forum Moderators: buckworks & webwork

Message Too Old, No Replies

DNS - Point domain name to subdomain hosted elsewhere

         

lxiaol

4:27 pm on Jan 4, 2008 (gmt 0)

10+ Year Member



Hi,

I have a domain name which I want to point to a subdomain of a website hosted somewhere else.
Is there a way to do this with DNS settings?
Cus in the A type, I'm only able to type IPs...

jtara

4:58 pm on Jan 4, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



DNS does not do redirection.

DNS does not do redirection.

DNS does not...

HTTP redirection requires an HTTP server.

If the site you are redirecting to is on a dedicated IP address, then you can just use an A record. You will need to get the IP address of the server.

If it doesn't use a dedicated IP address (virtual server) then you will have to do an HTTP redirect.

Some registrars and third-party DNS providers do provide a redirect service. They provide an HTTP server to do the redirects. I can't give you advice on how to use these, because they are implemented differently in each case. Most wave a magician's hand over it, making it look like a DNS feature. That's why I felt compelled to mention that...

DNS does not do redirection.

lxiaol

12:02 am on Jan 5, 2008 (gmt 0)

10+ Year Member



I'm not asking for a redirection.
If I wanted that, I could just point the domainname to an IP and redirect from the IP to another location with PHP or HTML, but I need to point directly to a subdomain. But I don't think that's possible since subdomains don't have their own IPs :/

jtara

1:30 am on Jan 5, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



but I need to point directly to a subdomain. But I don't think that's possible since subdomains don't have their own IPs :/

That's not true.

First of all, you almost certainly don't actually mean "subdomain". You probably mean "host". But the term is so misused that it's best to have you describe EXACTLY what you mean. Since you can't give your real domain names here, give an example using "example.com".

Anyway, whether or not a "subdomain" (whatever you mean by that) has it's own IP is an implementation detail. They (whatever they are...) certainly can have their own IPs.

example.com 1.2.3.4
www.example.com 1.2.3.4
sub.example.com 2.3.4.5
www.some_other_domain.tld 5.6.7.8

All perfectly valid. Now, your host may or may not allow or give your the capability to have different IPs. But that's not the same as "don't have their own IPs".

Anyway, the real issue here is whether or not the site you want to point-to has a non-virtual web server hosting a single domain, or is a virtual server hosting multiple domains on a single server.

If it is not a virtual server, then you can simply point an A or CNAME record to it. (A records use IP addresses, CNAMEs use DNS names.)

If it IS a virtual server, then it will have to be configured to recognize the new domain name, no ifs ands or buts. You can point an A or CNAME to it, but users are going to get the "base" server, which most often is configured to just give an error message.

If the server you are pointing-to is not yours and/or you cannot alter it's configuration, and it's a virtual server, you simply can't do this. The best you can do is a framed HTTP forward.

Keep in mind, that ALL DNS does is convert names to IP addresses. It doesn't even know that the web, web servers, or HTTP exists.