Hosting an external subdomain & DNA Manager

Hello and my apologies in advance if this is a Level1 noob question:

I have a compadre which is hosting elsewhere and has his DNS managed through his hosting company. We would like to have one of his subdomains pointing to my server so I can build a site on my server and manage it through my set up. We don't want a simple redirect but have the subdomain fully implemented on my server.

I know how to use DNS manager but I am confused if I suppose to make any entries on the main domain's zone file (I have several ones) or if this is something I need to configure at the server level with virtual hosts or both.

Any kind soul could hint me at to what is the proper way to go about this?

THanks

4 Replies

Whoever owns the main domain, needs to setup the subdomain record. That record can point to anywhere, including your LINODE Public IP. Then you setup a Virtual Host for that Subdomain.

First, have your friend add the DNS entry with his provider so the desired domain name resolves to your server's IP address.

Second, configure your server (as appropriate for the web server and/or application you're using) to service that domain name. For a web server, that would be a standard "virtual host" configuration.

The first bit takes care of resolving the name people use so that they contact your server, and the second takes care that your server does the right thing when those people access it.

– David

PS: Under some circumstances, and depending on the capabilities of your friend's DNS provider, it is theoretically possible for your friend to delegate the actual DNS administration for the subdomain to you (at which point you could do the first part yourself through whatever DNS provider you use, or Linode's own DNS manager), but that can get complicated and for simply acting as the host for a single domain name is unlikely to be needed/desired.

Thanks you very much for the assistance on this. I truly appreciate it.

I almost have this working but for one small thing: The external subdomain points to its root folder at Linode just fine, so If I type http://subdomain.domain.com , it happily goes to to root. However, any directory/file below that will not work unless I include the root directory into url path again:

subdomain.domain.com-> DocumentRoot is /var/www/topdirectory. Inside I have a directory and a file: /var/www/topdirectory/somedirectory/index.html

if I visit http://subdomain.domain.com, the root at /var/www/topdirectory loads fine.

if I go to http://subdomain.domain.com/somedirectory/index.html I get an error (URL not found)

if I go to http://subdomain.domain.com/topdirectory/somedirectory/index.html I get no error, but the root path should not be there.

I know this is gonna be a Rewrite module thing but I cannot figure out what. I am guessing I need to write a rewrite rules on the apache file OR make an .htaccess file for that directory.

Any chance you your may have a a hint as of what I need to do?

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct