0

Is it possible to have a specific domain name have a dynamic routing, so for instance,somedomain.com goes to ip address x. but if the server at x goes down, the dns starts directing traffic to ip address y etc.

In that case a website would only be down if multiple servers in multiple locations would fail nearly simultaneously. Which is a lot better than just a single failure causing an outage.

4
  • Have you looked at how heartbeat works? Feb 19, 2020 at 16:35
  • no. dont even know what that is.
    – john-jones
    Feb 19, 2020 at 20:27
  • Well in simple terms heartbeat is a daemon that behaves a bit like a cluster server. If a node in the cluster goes down, then heartbeat will ensure traffic is redirected to a node that is online. Feb 20, 2020 at 6:27
  • but what if the heartbeat server/computer itself goes down? is there a link to this somewhere?
    – john-jones
    Feb 20, 2020 at 7:42

2 Answers 2

1

This is not the role of DNS service. You can have several A / AAAA records pointing to all possible IP addresses where is service running. The Client will get all of them in random order (so the order will differ in answers).

It will be up to the decision of the client (or implementation on client side) how it would be handled. Normally it would be try the first one and in case of failure (not refuse but failure in communication) try another one.

In case you want more servers but populate just one IP there is reverse proxy role for that. One IP for reverse proxy which will know about all availability of the servers and handle the traffic by the priority or load balance it over the server based on the configuration.

1

What you are describing is basically how CDN (Content Delivery Networks) work.

The DNS aspect is not exactly as you suggest, but the DNS server returns different IP addresses depending on where the requester is. This ensures that the returned address is relatively close (in network terms) to the requester.

The IP address in returned isn't directly associated with the actual server that will deliver the content, but with a device called a load balancer. This device divides it's incoming requests between a pool of servers that actually service the request. It also monitors the health of the pool of servers and will stop sending requests should any fail. (It can also act in a hot spare mode, where all traffic is sent to one server until it fails, at which point the load balancer will switch to a second server).

The closest you can get with just basic DNS is to have multiple IP addresses mapped to the same domain name, in this case the DNS server uses what is known as "round-robin" balancing, this means that is works through the list of IP addresses in order for each request. This means that traffic will be balanced across all the IP addresses but still sent if one is dowm

1
  • This solution offer all the time the same IP based on just where you are asking from. It will not change the answer depending on the status of the server providing the service (as has been requested). Next to it not all the time this can be covered by "public" DNS servers operated by ISP / TELCO; Next to it CDN is related to static content. In case there are more servers actively process the request and change the answer based on it this scenario is not covered by the CDN concept. ; Round-robin "feature" of DNS is relevant and the most probably the best fit option to the question ;-).
    – Kamil J
    Feb 19, 2020 at 14:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .