Cross-VPS subdomain

Looks like this has been asked before, but it's not solving my problem in this case:

I have a Linode hosting one site. I have a second Linode which contains an application that I want to access through a subdomain of the domain of Linode 1.

Currently, I have created the A record for the domain on Linode 1 in the Linode DNS Manager, which points at the IP address of Linode 2.

I have also created an nginx vhost record for the subdomain:

server {
    listen   80;
    server_name beta.XXXX.com;
    access_log /srv/www/beta.XXXX.com/logs/access.log;
    error_log /srv/www/beta.XXXX.com/logs/error.log;

    location / {
        root   /srv/www/beta.XXXX.com;
        index  index.html index.htm;
    }
}

There is also a primary domain for Linode 2, which works fine (although currently it is disabled), and if I go to Linode 2's IP address, i get the default "nginx is working" page.

I have no reason to suspect that setting up the subdomain nginx vhost entry didn't work, as the error.log is blank.

However, I'm getting DNS failure when trying to connect to the subdomain. (i.e. page cannot be found)

Is there something i'm missing? Do I need to create a duplicate A record in the master zone for Linode 2 that matches the subdomain of the master zone for Linode 1? This is also the first time i've worked with nginx so is there something i'm missing there? A vhost ordering issue maybe?

Thanks.

2 Replies

So basically you will have 2 different linodes under 2 different domains. You just link to the second domain from the website of the main domain?

If you're getting DNS errors that's -before- you even reach nginx or the entire linode server. Normally all you need to do is create an A/AAAA record for the subdomain (beta) that points to the IP of your Linode 2.

Note that it does usually take 15-30 minutes before Linode DNS is changed throughout all their nameservers, and you may also have some DNS caching yourself. Try doing a dig @ns{1-5}.linode.com beta. to see if it resolves.

Without giving us the domain you are having issues with we can't really help you diagnose the issue.

Looks like it may have been an issue with DNS caching locally. The domain seems to resolve without issue this morning.

False alarm! Thanks for the comment about dig though, I wasn't aware of that tool.

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