0

How do I ensure a request for one of my two domains pointing at my linode doesn't become the other domain in the user's browser?

I think this is a DNS problem, so I'll explain...
I have a linode and 2 domains (first.com and second.com). I want them to both pointing at my single linode. If I visit second.com, I want to see second.com in my URL bar, NOT first.com.

But when I request second.com, the browser requests first.com instead. It's not a redirect (verified with wireshark).

I have configured the registrar for both domains to point at linode's nameservers, and made dns zones for each domain, according to linode's docs.

This has to be something wrong with my DNS configuration because it happens on many different (but not all) computers and mobile devices.

My DNS config is by the book:

These are my zones:

first.com   master  2015-03-22 02:47:07 ACTIVE
second.com  master  2015-03-22 02:45:18 ACTIVE

The zones are identical except where it says the actual domain name, of course.

Here's the zone for first.com:

; first.com [579491]
$TTL 300
@   IN  SOA ns1.linode.com. myemail.gmail.com. 2015032193 14400 14400 1209600 300
@       NS  ns1.linode.com.
@       NS  ns2.linode.com.
@       NS  ns3.linode.com.
@       NS  ns4.linode.com.
@       NS  ns5.linode.com.
@           A   198.58.127.172
www         A   198.58.127.172
@           AAAA    2600:3c00::f03c:91ff:fe6e:392c
www         AAAA    2600:3c00::f03c:91ff:fe6e:392c

Here's the zone for second.com:

; second.com [680193]
$TTL 86400
@   IN  SOA ns1.linode.com. myemail.gmail.com. 2015032191 14400 14400 1209600 86400
@       NS  ns1.linode.com.
@       NS  ns2.linode.com.
@       NS  ns3.linode.com.
@       NS  ns4.linode.com.
@       NS  ns5.linode.com.
@           A   198.58.127.172
www         A   198.58.127.172
@           AAAA    2600:3c00::f03c:91ff:fe6e:392c
www         AAAA    2600:3c00::f03c:91ff:fe6e:392c

Strangely, "incognito mode" or "private browsing" in my browser(s) works properly (second.com stays second.com). Flushing the DNS cache didn't work. For the record, I don't care what page gets served, and I've verified the host application is not forwarding or issuing a redirect (it happens even if I'm hosting with ncat on my server).

1

The only difference in the DNS records is your TTL though that won't be causing the problem. Assuming that you've waited at least 48 hours for the DNS propagation then the likelihood is your caching, or your virtual host file.

Many people assume that a ipconfig /flushdns or -flushcache on a Mac will correct any browser issues, while this can help its worth noting that caching DNS happens on many different tiers.

  • Routers cache dns
  • Browsers cache dns
  • Operating systems cache dns

Generally rebooting your router will clear the dns on router, while some you need to login as the administrator and clear it. Browsers are notorious for caching DNS, most do it and you can clear the cache by installing an addon such as Flush DNS or entering advanced options. Additionally you need to ensure you clear the DNS in the OS and the router before hand, otherwise it'll simply cache yet again.

Other than that if that doesn't solve your problem then its your virtual host file or your hosting, which you're need to contact linnode.

  • Excellent checklist! I used this to reduce potential problems to the point of contention, chrome cache wasn't actually flushing. I will accept this answer because my particular solution is too specific to be useful to the community. – James M. Lay Mar 22 '15 at 17:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.