Many have recently suffered from the simultaneous fall of thousands of servers, first in the fire at hosting.ua, and then when disconnected at McHost. Hooked me too. I did not earn money on dead sites, but mail is constantly needed for business correspondence. Despite the fact that my mail was transferred to Google (or as an option on Yandex), not a single letter could reach me, because along with the servers, the Name servers also died, and the senders simply could not read the MX record for my domain. In total, I spent 26 hours without explaining to all the people I work with that they need to duplicate all letters to another box - quite humiliating and not professional.
How to force mail to work even if all servers of a hoster lie?
So, we will deal with the reliability of the DNS. In principle, there is no mystery here - DNS was originally conceived to be reliable, that’s why you will need to specify 2 NS servers when registering domains in some zones.
About terminology
Without going into details, so that everyone could understand:
DNS - Domain Name System - allows you to get its IP or value of special records by the symbolic name of the site. It is through DNS that mail servers will find out which server to send mail for this domain (this is indicated in the MX records).
NS - Name Server. Server that responds to requests for this domain. NS are Primary — it is the configuration files (Master) that describe what data to give, and Secondary (usually Slave) - they regularly copy information from Primary, and serve as a “backup copy”. Secondary servers can be several. When both (all) servers are working - the load is distributed evenly on all.
AXFR - type of query to the DNS server, in which he gives everything he knows by the requested domain. The so-called "zone transfer". Through this query, Secondary NS receives all information from Primary NS on the desired domain. Usually, AXFR requests are allowed only for a small group of IPs, so as not to reveal to outsiders unnecessary information (for example, the existence of “secret” subdomains).
')
How everything is often done:
Suppose we have a website xyz.ru, NS servers are often used from the provider (and Primary and Secondary). Sometimes Primary and Secondary generally work on the same server, just on different IP. Accordingly, on these NS servers there are MX records that are used every time when you need to send mail, even if mail is used from Google or Yandex.
At one fine moment, the entire DC is burning down, or the installer uses a switch to cut down 70 Gbps of optical fiber, the sites fall by themselves, they are no longer accessible from the outside. However, mail processed by Google / Yandex servers will also not work, since senders will not know which server to send mail for you. Such problems can occur even if the connection is broken for some 5 minutes. Of course, the sending server will put the letter in the queue, and will still try to send it later, but this may cost you many hours to receive the letter.
How can hosters do it right?
In theory, they should keep the NS servers in different, unrelated DCs. In practice, no one wants to spend extra money, and both servers are often set up in their own DC, for it is so “cheaper”. In addition, if both NS servers belong to the same company, all the same there are some risks (for example, masks-shows with the removal of all servers from all DCs), and the method proposed below still makes sense.
What can you do yourself?
Use an independent Secondary server. For example, on
xname.org . There you can make a Secondary / Slave server
for free (records are copied from your primary NS, for this your primary NS must resolve AXFR requests from 195.234.42.1, 87.98.164.164 and 88.191.64.64). In the event that your server or the entire datacenter crashes, the mail will still walk regularly, because MX records will be received from the Secondary server. If AXFR fails to resolve, you can make a master server, and manually copy the DNS records.
Update: Xname is not the only option, some say it is buggy. There are other free DNS hosters, as well as paid ones, from $ 1 a year from nic.ua.
More tricks
You probably want to show users a stub, or deploy a site from a backup on another server. However, since your Primary DNS is down, you will not be able to change anything there, and you will have to transfer the domain to the new NS servers, which may take more time (as many more when you return everything). To solve this problem, you can do the opposite: do Primary DNS on XName.org, and on your server run bind9 as a Secondary DNS server. In this case, if XName.org falls, everything will work fine from the cache of your personal Secondary NS, and if the DC falls, you can quickly redirect users to a new server on XName.org.
I hope this article will help you prepare for the next epic server crash, and maybe for a nuclear war.
Ps. And make backups every day in a physically distant place, today it happened with us, tomorrow with you.

According to the results of the mini-study,
about half of the hosters keep both the Primary and Secondary NS servers in one place, and if there are problems with the DC, they will both fall at the same time.
Comments / comments / errors are welcome.