Add a subdomain to direct to a test domain

I restored a backup of linode y.y.y.y to a new linode with IP x.x.x.x. Currently my domain records point to y.y.y.y

I would like to test this backup and I thought I could add a new A/AAAA record in mydomain.com with domain test and ip x.x.x.x. I then expected that the url http://test.mydomain.com would direct to ip x.x.x.x. What actually happens is that http://test.mydomain.com redirects to http://mydomain.com at IP y.y.y.y.

I also have an A/AAAA record for *.mydomain.com which points to IP y.y.y.y. Could this be the issue? My web server is setup to handle different apps such as app1.mydomain.com and app2.mydomain.com, which I think is why I added this record. I believe I could change the *.mydomain.com to a specific myapp1.mydomain.com if needed (I only have 1 app currently).

1 Reply

Without knowing the specific domain, I'm going on a hunch here - did you set up a wildcard DNS record for your website? Wildcard DNS records work to redirect any subdomain not recognized back to the regular domain. Like, https://randomword.mydomain.com would redirect to https://mydomain.com unless there's an A record for https://randomword.mydomain.com that would point to a specific IP address.

There's also DNS propagation, which can be affected by the TTL on a domain that already exists. I usually use DNSChecker.org while working with DNS issues. It checks from servers around the world to test where different locations see whatever changes are being made.

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