asnair
By:
asnair

after migrating to another location, the A record of both the droplets point to same domain name. Which gets priority?

February 4, 2017 406 views
DNS

after migrating to another location, the A record of both the droplets point to same domain name (while the IP of the new site is under propagation). Which gets priority after propagation is complete?

1 comment
  • Both the droplets have the same name servers of digitalocean -- so the domain arrives at digitalocean. After that this get directed to which droplet? Old, new? Neither?

    I have kept both the droplets powered on, as I do not want the site to be down.

3 Answers

Do you mean the PTR record? Because that's not what decides where a domain goes.

  • No I did not mean the PTR record. Digitalocean does not allow the use to configure PTR record

    • Then what did you mean? If you meant nameservers, it goes wherever you configured in DNS.

      • Yes, I meant nameservers of digitalocean (DO). Both my droplets (each in a different droplet in DO, and each with different IP addresses) are now configured to point to the same dns. I have not deleted the entry in the old droplet as that would put my site down. Also I am not sure how long the propagation (and hence site being down) will take place.

        As suggested by jlittle, I shut down the old droplet about 4 hours back. The propagation to the new IP has still not taken place, and so I have restarted the old droplet just now -- to get my site up.

        • I'm still confused, "both droplets [..] point to the same DNS" makes no sense.

Should I have to power off the old droplet while the new ip is propagating (and reluctantly accept the site downtime in the meanwhile)?

@asnair

When it comes to migration, the ideal scenario would be that you migrate the data from one Droplet to another and then change your DNS.

You don't want to setup two A entries for the same domain that point to two different IP's -- you want to swap the current IP with the new and allow the other to resolve.

You can, of course, shutdown the old Droplet, though that doesn't force the DNS to resolve faster. It will, however, eliminate the potential for visitors that come to your website from potentially hitting the old server.

In most cases, once your DNS is setup (i.e. initial setup of name servers for your domain), changes such as new IP's and new entries resolve rather quickly.

  • Thanks jtittle.

    I had already migrated the data before setting the DNS. I have also moved the source code files to the new droplet. The site is ready to run, once the propagation is complete.

    Yes, ultimately it would be swap of one IP with another. But as the new IP has not propagated, I have not powered off the old droplet. (I can later move the new entries in the database table to the new droplet. That is not a problem -- even if visitors hit the old old server in the meantime.)

    From what you wrote, I feel I need to wait patiently till the DNS propagation is complete -- and then backup the database of the old server and the power off that droplet. Is that okay?

    • @asnair

      If you still have two A entries for your domain, one pointing to the old and one pointing to the new [IP], the DNS isn't going to resolve as it normally would. So before anything else, you need to make sure that the A entry for your domain is pointing to just one IP -- delete the other entry (i.e. the old Droplet IP).

      Once that's taken care of, then you can test for propagation. If it doesn't resolve, try clearing your browser cache as well as any local caches you may have (on your PC/Mac/Linux machine).

      If clearing your cache doesn't work, then you'll have to wait until the IP resolves. Normally, it doesn't take too long once your DNS is already set, though in some rare cases, I've seen it take up to 24-48 hours.

      • As suggested, I shut down the old droplet about 4 hours back. The propagation to the new IP has still not taken place, and so I have restarted the old droplet just now -- to get my site up.

        As my domain is from a 3rd party (namesilo), they correctly resolve the nameserver and takes any request of my domain to the common IP of dgital ocean. Then it is for Sentora (which functions as the cpanel within digitalocean) to direct the request to the correct IP of my droplet. This should not take so long.

        Even after I powered down the first drupal, how come DO is still directing the domain request to this droplet, and not to the powered on new droplet?

        • @asnair

          To see if there's an issue with your DNS, I'd need for you to either post the DNS in a code block or take a screenshot of the DNS and provide me with a link. That'll allow me to see if there's something we need to do there.

          When it comes to DNS, who's managing the DNS for you? Are you setting up your DNS entries through the Networking page of the DigitalOcean Control Panel, via NameSilo's control panel, or through an interface managed by Sentora?

          Beyond DNS, if there are any hard-coded IP addresses in your configuration, you'd need to make sure to check there too. This is especially true when it control panels come in to play.

          • Thanks all of you. The problem is solved. It was all a stupid mistake on my part, I had misspelt the domain name in the new droplet. After this was corrected, the DNS propagation happened in less than 1 hour. And the site is up!

Have another answer? Share your knowledge.