3

I have two servers, one in OVH, and the other in Hetzner.

For my domain, in the domain control panel, I have listed two name servers, each pointing to one of the servers, each with an active DNS resolver. Both DNS resolvers report both IPs for the A records (the main domain and the www subomain/version). The TTL is set to as default (14400). Also, both servers report both nameservers consistently (the NS records are the same) and the SOA records of both DNS resolvers are identical, so I got no errors or warnings when I checked it by dnscheck.pingdom.com.

My website is rarely updated (static somehow), so I don't need software to synchronize the data on the servers. It is running on HTTP; no SSL/TLS.

Now, my main question is:

Will every user be able to connect to the site if one server goes down suddenly?

And suppose the servers are not going to be changed:

What if I set a long or short TTL: 864000 or 3600?

I would add that this is only to ensure that my website is available; it is not for round-rubin DNS, because my server load is quite low.

4
  • "Both DNS resolvers report both IPs for the A records" - presumably you mean that one DNS points to one server and the other points to the other. Both DNS don't have the same A records listed? "both servers report both nameservers consistently" - What do you mean by that? What request are you making to check this?
    – DocRoot
    May 26, 2018 at 9:10
  • In the domain control panel are two nameservers: ns1.example.com (pointing to server1) and ns2.example.com (pointing to server2). But No, both DNSes have the same records. In each, there are two A records for the main domain (also two for the www version), one of them to IP of server1, and the other to IP of server2. The only difference is the sequence of IPs. Server1 first lists its own IP for the A record and then IP of Server2. The same applies for Server2.
    – Siamak
    May 26, 2018 at 12:25
  • "both servers report both nameservers consistently" I mean the NS records in both DNS resolvers are identical: ns1.example.com and ns2.example.com
    – Siamak
    May 26, 2018 at 12:59
  • "Will every user be able to connect to the site if one server goes down suddenly?" no, not properly. they will at least get a long delay (when client is attempting to connect to the "wrong" IP) or even complete failures (if client cached only one IP and hence will never fallback on the other one). DNS (alone) is not suited to solve such problems. May 29, 2018 at 14:39

1 Answer 1

2

To do this successfully you really need some device for the user session to connect to that is acting as a smart reverse proxy (a load-balancer with server down detection), then to ensure redundancy you need two of those also operating as auto-hot-swap.

I would have a discussion with Cloudflare about how this is achievable.

11
  • 2
    Assuming the static site does not need session state, then a reverse proxy is not necessary and a round-robin DNS will do fine enough. However, round-robin DNS does not load share as well as a proxy would. Most of the time this is not an issue and round-robin DNS will do the trick nicely. Still, I prefer a proxy where possible.
    – closetnoc
    May 26, 2018 at 4:53
  • 1
    @Siamak I guess it would depend upon how you use cookies. With round-robin, users tend to stay on the same server. If a server drops from the rotation that will be handled. How transparent that is depends on the site itself. If static pages, no problem. If PHP with dependency upon cookies, not sure. It depends. I have been retired for a while so the details can be fuzzy.
    – closetnoc
    May 26, 2018 at 5:48
  • 1
    @Siamak I was not entirely clear on your set up, however it sounds like you are on the right track. To be sure, here is a link... en.m.wikipedia.org/wiki/Round-robin_DNS
    – closetnoc
    May 26, 2018 at 6:53
  • 1
    @DocRoot See... I really did not understand... [insert grin] I have to admit to being confused by the details... round-robin or proxy is the way to go. The choice is up to the OP. If session state is not required, which it seems, then round-robin should do nicely. Cheers!!
    – closetnoc
    May 26, 2018 at 17:14
  • 1
    @Siamak Anytime! We are all here for you. Cheers!!
    – closetnoc
    May 29, 2018 at 18:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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