Cross-VPS subdomain
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
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.
Without giving us the domain you are having issues with we can't really help you diagnose the issue.
False alarm! Thanks for the comment about dig though, I wasn't aware of that tool.