Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Fail over DNS
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Fail over DNS

If I have 2 servers that are almost identical and I need the second server to be used in the event that the second goes down I believe that is called fail over DNS.

What would be a good provider that offers this especially with a BF/CM deal?

Comments

  • Daniel15Daniel15 Veteran
    edited November 2021

    For DNS in particular, if you like trying to run things yourself (e.g. to learn), you can use PowerDNS with Lua records: https://doc.powerdns.com/authoritative/lua-records/. You can use the ifportup function to return a particular IP, and combine it with pickclosest to pick the IP that's up and is closest to the user (basic GeoDNS). You can also do round-robin with all the servers that are up.

    Just use a low TTL so that users get the new IP quickly when a server goes down. Using a low TTL isn't always ideal though, as your DNS servers will get more traffic, and page loads will be slower more often (since it'll have to do DNS lookups more frequently).

    The other option if the 2 servers are at the same provider is to use a load balancer, but not all providers offer them. This is a cluster of servers that sit in front of your servers, directing the traffic to the right servers.

    You can also get a third server that does the load balancing (e.g. using HAProxy), but load balancers provided by providers themselves are generally high-availability with multiple load balancing servers.

  • trycatchthistrycatchthis Member
    edited November 2021

    @Daniel15 said:
    great stuff

    Basically my primary concern is uptime. All I want right now is that if server 1 goes down that people go to server 2. When server 1 comes back up people go back to server 1.

    Any services for this with a goof bf/cm deal?

  • @trycatchthis Are both servers at the same provider, or are they two separate providers?

  • trycatchthistrycatchthis Member
    edited November 2021

    @Daniel15 said:
    @trycatchthis Are both servers at the same provider, or are they two separate providers?

    2 Separate.

  • pbxpbx Member
    edited November 2021

    You'll need something to check how the servers are doing (up? down?) and to tell the DNS provider's API (or your own servers) which one to use.

    A service that can check your web servers from multiple locations would be needed (uptime robot for example). It would have to then trigger an API that will change the IP. Many scripts on github to change IP on CF or other providers (for example this one). You could host it on a very small VPS.

  • These people seem to do it.

    I'm looking for a bf/cm deal if possible.

  • cloudns.net
    black friday promo still going on

  • To save your time, use cloudns.net.
    To save your money, use CloudFlare DNS with CloudFlare Worker.

  • Is it possible to create a Failover DNS with CloudFlare Worker?

  • or as free solution use Cloudflare quasi-roundrobin DNS - multiple A records can route visitors, in case one doesn't respond.

  • @gabydup said:
    Is it possible to create a Failover DNS with CloudFlare Worker?

    cf worker can monitor your api or w/e and update dns record with relevant ip in case of failure
    https://api.cloudflare.com/#dns-records-for-a-zone-update-dns-record

    Thanked by 1gabydup
  • JordJord Moderator, Host Rep

    Could use GDNSD, add the records and it will ping each server, add weight to the one you want to use the most and once a server dies it will be removed from the DNS.

    Thanked by 1FrankZ
  • The OP didn't really seem to be looking for a home-made solution, so in that case you simply need a DNS provider that includes monitoring. There's several of good ones - NS1, Constellix (DNS Made Easy), Route53, etc. But don't expect big BF discounts from them. GSLB.me might be a bit more budget-friendly.

    The next step back is to link an external monitoring service with a DNS service. For example, it is pretty simple to get Hetrix (or UptimeRobot or whatever offers webhooks) to update Cloudflare's DNS, which achieves the result. I've written a tutorial "somewhere else" about using an AWS Lambda function (which in theory should be highly available) to update DNS services.

    Then the most drastic is to run your own DNS, as some others suggested here. For some of my domains, I run an anycast DNS using pdns on fly.io. Personally I never rely on a single DNS provider for a domain.

    Thanked by 1pbx
  • @tetech said: GSLB.me might be a bit more budget-friendly.

    They are really cheap. Did you try them? Is their "health check" solid?

  • @pbx said:

    @tetech said: GSLB.me might be a bit more budget-friendly.

    They are really cheap. Did you try them? Is their "health check" solid?

    I've used it for a few years. Service is solid. The main knock is that interface is very clunky (like 1990's), and the DNS servers do not seem to be anycast. But if the objective is reliability at a decent price and you don't need to milk the last 0.1% of performance then it could be an option to consider.

    Thanked by 2pbx r3n
  • @tetech said: could be an option to consider.

    Never heard of them before, I'll try. Pricing is very low compared to Route53 if "health checks" are included!

  • Will check out GSLB.me.

  • @pbx said:

    @tetech said: could be an option to consider.

    Never heard of them before, I'll try. Pricing is very low compared to Route53 if "health checks" are included!

    My impression is that it is a family-run thing out of Italy and they probably aren't investing a whole lot back into it, so very different from Amazon! But around since 2007 and has worked OK for me. I use them for a few domains, where I have one NS with them and another with a different provider.

  • @tetech said: one NS with them and another with a different provider

    Using them as NS1 and adding a couple of different slaves, it should be pretty solid, even though it's not backed by a big company.

  • @pbx said:

    @tetech said: one NS with them and another with a different provider

    Using them as NS1 and adding a couple of different slaves, it should be pretty solid, even though it's not backed by a big company.

    I went back and looked at my config. For the domain in question, I've got NS in 3 different places - one is my own in-house pdns server, one is GSLB.me, and the other is LunaNode - I should have mentioned them earlier too. For existing customers LunaNode offer a free managed DNS which does have monitoring and failover. Again, their servers are not anycast (so basically Canada and/or France), so don't expect the N'th degree of performance, but quite reliable.

    Thanked by 1pbx
  • @trycatchthis said:
    If I have 2 servers that are almost identical and I need the second server to be used in the event that the second goes down I believe that is called fail over DNS.

    What would be a good provider that offers this especially with a BF/CM deal?

    Did you try using Nginx ?
    Ref: https://www.nginx.com/blog/load-balancing-dns-traffic-nginx-plus/

  • @bsh said:

    @trycatchthis said:
    If I have 2 servers that are almost identical and I need the second server to be used in the event that the second goes down I believe that is called fail over DNS.

    What would be a good provider that offers this especially with a BF/CM deal?

    Did you try using Nginx ?
    Ref: https://www.nginx.com/blog/load-balancing-dns-traffic-nginx-plus/

    Will check

  • bshbsh Member
    edited December 2021

    @trycatchthis said:

    @bsh said:

    @trycatchthis said:
    If I have 2 servers that are almost identical and I need the second server to be used in the event that the second goes down I believe that is called fail over DNS.

    What would be a good provider that offers this especially with a BF/CM deal?

    Did you try using Nginx ?
    Ref: https://www.nginx.com/blog/load-balancing-dns-traffic-nginx-plus/

    Will check

    You could install NSD nameserver on Alpine Linux or FreeBSD for 2 servers, listen on port 5353
    Then Nginx for 2 servers listen on port 53, with 2 backends above

    P/S: Nginx has geo-location module if you'd like to do geo- DNS server

  • @bsh said:

    @trycatchthis said:

    @bsh said:

    @trycatchthis said:
    If I have 2 servers that are almost identical and I need the second server to be used in the event that the second goes down I believe that is called fail over DNS.

    What would be a good provider that offers this especially with a BF/CM deal?

    Did you try using Nginx ?
    Ref: https://www.nginx.com/blog/load-balancing-dns-traffic-nginx-plus/

    Will check

    You could install NSD nameserver on Alpine Linux or FreeBSD for 2 servers, listen on port 5353
    Then Nginx for 2 servers listen on port 53, with 2 backends above

    P/S: Nginx has geo-location module if you'd like to do geo- DNS server

    The problem with that is I would have to maintain 3 servers from 3 providers. I want a reliable dns.

  • @PearlMoon said:
    or as free solution use Cloudflare quasi-roundrobin DNS - multiple A records can route visitors, in case one doesn't respond.

    Wouldn't you still get a percentage of visitors routed to the non-responding A record?

  • SaahibSaahib Host Rep, Veteran

    @trycatchthis said:
    If I have 2 servers that are almost identical and I need the second server to be used in the event that the second goes down I believe that is called fail over DNS.

    What would be a good provider that offers this especially with a BF/CM deal?

    You can do exactly you want but would not be cheap as per LET standards, check out dnsmadeeasy.com , their business plan which USD 59.95 pa .

  • @Saahib said:

    @trycatchthis said:
    If I have 2 servers that are almost identical and I need the second server to be used in the event that the second goes down I believe that is called fail over DNS.

    What would be a good provider that offers this especially with a BF/CM deal?

    You can do exactly you want but would not be cheap as per LET standards, check out dnsmadeeasy.com , their business plan which USD 59.95 pa .

    I know some people offer it I was looking for a BF/CM deal though.

  • SaahibSaahib Host Rep, Veteran

    @trycatchthis said:

    @Saahib said:

    @trycatchthis said:
    If I have 2 servers that are almost identical and I need the second server to be used in the event that the second goes down I believe that is called fail over DNS.

    What would be a good provider that offers this especially with a BF/CM deal?

    You can do exactly you want but would not be cheap as per LET standards, check out dnsmadeeasy.com , their business plan which USD 59.95 pa .

    I know some people offer it I was looking for a BF/CM deal though.

    Try this https://www.cloudns.net/premium/ , they have upto 50% for bf deal.

  • PearlMoonPearlMoon Member
    edited December 2021

    @gabydup said:

    @PearlMoon said:
    or as free solution use Cloudflare quasi-roundrobin DNS - multiple A records can route visitors, in case one doesn't respond.

    Wouldn't you still get a percentage of visitors routed to the non-responding A record?

    note: cloudflare proxy is disabled (dns only mode)

    for me, AAAA record (ipv6 traffic) is routed fully to first record available (online)
    if first down -> second is served
    if first up again -> still served from second (as expected)

    you need to clean dns cache on the consumer machine if you want to route to the first one after the recovery

    GL

Sign In or Register to comment.