Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I'm not very savvy with domain names.

Basically I have a dedicated Windows hosting server for a web application that is located at a location like this:

123.234.345.456/script.aspx

I need to map a domain name to this location. Don't ask why I can't just map it straight to the ip address - I didn't create the application and the index page isn't in use. I just have to map it to the specific script.

How would I do this using A records? (or MX records, or CNAME or SPF - those are the options I have). I don't have any nameservers.

Thanks

Tom

share|improve this question
add comment

2 Answers

up vote 3 down vote accepted

DNS cannot resolve to individual pages; however, your server can decide what is served up to a client who does not request a specific page. As you mentioned, this is usually index.xxx or default.xxx, depending on what server you use. But, there is a way to do what you're looking for.

Step 1: DNS

So, first things first; as Matthew Brookes mentioned in his answer, you'll need to create an A record for that IP address. If this is the only thing on that domain, you probably want to use @ as your host, which is a wildcard. If I visit example.com, or thisrecorddoesnotexist.example.com, it will direct you to the IP you set in this record.

This will get you the example.com/script.aspx address, but won't take people directly to it, which brings us to Step 2.

Step 2: Default Document

I'm assuming you're using IIS, because of the aspx filename. Anyways, you can set the Default Document of your web site to something other than default.aspx or default.htm.

In IIS properties, under the web site in question, click the 'Documents' tab (Note: This is in IIS6, don't know if 7 is different) and add your script name to the default documents, at the top. That way, whenever someone visits example.com, they will be presented with your script by default.

Step 3: Couldn't do Step 2

Not everybody has access to configure their server, especially if you're using shared hosting of some kind. So, as a backup, you could always create a default.aspx document that redirects the user to the correct page. This wouldn't require any additional server configuration.

Step 4: Profit

So, I think that should do what you're looking for.

share|improve this answer
    
This was how we had to do it in the end. I got the dev to make a default.aspx that redirected to the script and set the a record to the server. Now, had a funny issue which was that we had to change the nameservers, even though I'd set an a record. I was under the impression that an a record overrode the the nameservers? –  Thomas Clayson Apr 11 '11 at 9:03
    
@Thomas Clayson: Nameserver records contain the address of the DNS servers that should be queried for your domain, so they do get checked before the A records. –  Jacob Hume Apr 11 '11 at 12:11
add comment

MX records are for email so thats out. SPF records relate to email as well (Sender Policy Framework)

So that leaves you with an A record or a CNAME. I normally use a CNAME if i am not provided with an IP address. Therefore i would opt for an A record.

One thing you have not indicated is whether you have a Domain Name already?? If not you will need to purchase one of those through a domain register i would look for one which gives you full DNS control you can then use that to point the Domain Name at the IP address you have using an A record. The company who you purchase the domain name though normally act as your Name Servers as well.

share|improve this answer
    
Yes, I have the domain name. :) Thanks, the problem is the dns won't let me make an A record with a / in it. –  Thomas Clayson Apr 11 '11 at 9:01
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.