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 would like to know how to create a subdomain that is a link to an SQL Server database. I have Windows Server 2008 R2 and SQL Server 2008. I have a static IP on the Windows server, and I have a domain at GoDaddy with the A host record pointing to the static IP.

I can successfully establish a remote connection to the SQL Server instance through SQL Server Management Studio. But I have to use the www.mydomain.com instead of something like sqldbmain.mydomain.com, which is what I would prefer to use.

For another example, if I create a SQL database at some web host like GoDaddy, they give me an external link to my DB like sqldb1234.db.hostedresource.net. That is what I'm trying to replicate.

I'm not sure whether this is something that has to be managed through IIS on the Windows server, through the domain management at GoDaddy, or through SQL Server management, or even a little bit of all of them.

EDIT

For clarification, I'm accessing the database through SQL Server Management studio. In the field where it asks for the "Server Name" is where I enter www.mydomain.com, but I would like to enter the value similar to sqldb1234.db.mydomain.com.

share|improve this question
    
How did you access the SQL Server database through a browser previously (i.e., using the IP address)? –  dan Nov 20 '13 at 1:31
    
@dan: Please see my edit. –  jwatts1980 Nov 20 '13 at 14:38
add comment

1 Answer 1

up vote 2 down vote accepted

You need to create an A record for sqldb1234.db in your DNS area for GoDaddy.

http://support.godaddy.com/help/article/2290/how-do-i-create-a-subdomain-in-simple-control-panel

Once the A record has propagated you should be able to use the subdomain sqldb1234.db.mydomain.com in your connection string.

share|improve this answer
    
Thank you. That sounds very promising; I will try it. I am curious, if create that A record and it points to the same IP as the @ record, then will sqldb1234.db basically be an alias to the www? I mean, wouldn't www.mydomain.com and sqldb1234.db.mydomain.com both allow a successful connection to the database? –  jwatts1980 Nov 20 '13 at 17:01
    
That was what I needed. I understand now why it helps to use the A host record. Since I can control which IP the subdomain points to, if I need to move the SQL Server to a server with a different IP later, then I can just update the IP in A record and my URL stays valid. All the little dots are connected now :) Thanks again! –  jwatts1980 Nov 20 '13 at 17:39
    
That's right! Glad I could help :) –  QF_Developer Nov 20 '13 at 21:40
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.