Score:0

How to setup DNS so I don't need to change A PTR everytime load balancer IP changes?

cv flag

How should I setup DNS such that I don't have to change 20 A records for different domains everytime the k8s load balancer IP changes?

Normally I setup an A record called 'k8s.domain.com' that points to the k8s cluster. I then use CNAMES for all the subdomains that points to 'k8s.domain.com'

However there are some domains that need to point to the kubernetes cluster and you can't use a CNAME for a root domain.

Is there a way to setup a nginx ingress or a proxy, such that the A records point to a static fixed IP, and then that is configured with the load balancer IP such that I only need to change the IP in one place if the load balancer is redeployed and the load balancer IP changes.

I know this is just a lack of knowledge of best practices. Please enlighten me.

pt flag
I'm confused if you're talking about `A` records or `PTR` records. If the latter, I would just say don't bother.
Nate Houk avatar
cv flag
I am talking about A records.
Nate Houk avatar
cv flag
I edited the question to clarify I meant A records.
Score:0
za flag

If you use "second-level domains" which doesn't allow for CNAME like example.org, unfortunately, you stuck with A record, and if IP address changes you need to update that A record. No way around that.

However, you may automate DNS updates if you host DNS servers yourself or if your DNS hoster has an API, so that problem boils down to writing a script and running it whenever the IP changes.

Any of the solutions you've mentioned could work or not, depending on what service is there. The problem with load balancers or proxies is that you can lose the original client IP address (the proxy's IP address will be logged instead). If all server software that you want to put behind in this way supports haproxy's PROXY protocol you may really have some fixed IP address and run haproxy in TCP mode on it to go around this problem.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.