• 0

DNS Help


Question

I'll try my best to explain my issue.

I pay a web hosting company for a service. To login into the portal for this service I would go to the following (fictitious) address. http://www.why-me.com/help

I have my own registered domain. I would like to create a record that on the DNS for my domain that would redirect the traffic to the portal address above. something along the line as http://forward.domain.com would forward to http://www.why-me.com/help

I tried creating an A record for "forward" and assigning it to the ip address i was given for the portal site. But when trying to access http://forward.domain.com it redirects me to http://www.why-me.com. So I am getting to the main site, not my portal page.

I then tried to create a CNAME for "forward" and pointed it to the A Record. That also did not help.

If I had to guess, I think the ip address that the portal resolves to is a shared ip. Make sense?

If that is the case, I don't believe there is a way for me to achieve my goal using DNS. Is there an option to have the web hosting company point a static ip address to the folder that is running the portal? If so, is this option available on all web servers? I believe the web server is running iis.

Any direction you can offer would be appreciated. Thanks.

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

you don't seem to understand how everything works at all

id9JEd5j1Hp7i.jpg

in the URL "foo.example.com/bar", the domain portion is "foo.example.com". "com" being the top level domain (TLD), "example" second level, "foo" third level. the TLD is the domain extension for public (i.e. on the internet) domains, which means for web purposes the second level domain is the main one, so to speak.

DNS records for "example.com" will have one or more IPs as A records, which translates "example.com" to the actual numerical address of the server that your site is stored on. With dedicated IPs the IP alone is sufficient to load your website, with shared the IP points you to the server, and the server looks at the domain name that was requested and serves the right page. So basically "example.com" tells the internet where you are.

The same thing happens with subdomains, sub-subdomains, etc. Usually they point to the same IP as the main "example.com" domain, because they're generally used as sub-parts of your website, but you can specify any arbitrary IP address on them if you want to.

A CNAME record can be set on a domain/subdomain/etc. and the value is another domain name, e.g. "example.org" or "baz.example.org". Basically that just tells anyone requesting the domain "hey I have the same DNS records as that other domain, so use those records". It's useful when you want to alias a domain to another, for example. So a CNAME record on "foo.example.com" with the value of "bar.example.org" will cause the requesting person to make a second DNS request to "bar.example.org" and use those records, which makes "foo.example.com" a copy of "bar.example.org".

the folder path, the part after the "/" doesn't come into any of this. The IP address of a server, and hence domain names tell you, and only tell you which server it is on. When you give something a URL like "foo.example.com/bar/baz/qux.txt" it first takes "foo.example.com", finds the DNS records, and figures out which server it is on. Then it talks to that server and asks the server to send it the file "qux.txt" which is located in the "/bar/baz/" folder.

So what did you do wrong?

First, it was likely a dedicated IP because when you visit that IP it shows you the homepage of the service provider. If it was shared it would show you a generic error page or placeholder or nothing at all. And service providers usually do use a dedicated IP for their own homepage.

Second, I have no idea what you mean by creating a CNAME record on "foo.example.com" pointing to the A record of "foo.example.com". Did you use "foo.example.com" as the value of the CNAME record? you can't use the same domain as the one you're setting the CNAME record on for obvious reasons. Did you use an IP address as the value? You don't do that because IP addresses don't have DNS records associated with them, they are actual addresses that point to actual servers. CNAME records are used to make a domain use the same DNS records as another domain.

Third, even if a CNAME record does what it appears that you thought it does, namely forward requests (which it doesn't, see above), the only thing that you told anyone was where to find the server, but not the path on the server where you can locate the page you actually want.

Fourth, you don't assign an IP to a folder. the folder is a location on the server, the server has an IP.

A records and CNAME records don't do what you want to do. What you actually need to use is a HTTP 301 (permanent) or 302 (moved temporarily) redirect that redirects visitors of "foo.example.com" to "example.org/bar". These redirects aren't DNS records so whether you can specify this behaviour in the domain manager directly is dependant on who your DNS host/domain manager provider is. I can specify 302 redirects on mine, for example, and they'll automatically send the HTTP response to anyone requesting a domain. If you can't do this in whatever manager you have, you should be able to configure the subdomain to point to your hosting service then configure the host to send that redirect response to all requests to the address. You can also always just use a small script as the index page of the subdomain and issue a redirect with it, e.g. http://php.net/manua...ion.header.php.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.