I’m trying to set-up a Custom DNS Server on an 22.04 Ubuntu EC2 that will listen on multiple Public IPs.
That Ubuntu EC2 has 3 IPs, 1 primary private IP and 2 secondary private IP.
So what i’m basically trying to do is:
Domain1 (route53) -> Elastic IP 1 -> Priv IP 1 (primary) - 172.0.0.10 - OK
Domain2 (route53) -> Elastic IP 2 -> Priv IP 2 (secondary)- 172.0.0.11 - NOK
Domain3 (route53) -> Elastic IP 3 -> Priv IP 3 (secondary) - 172.0.0.12 - NOK
The problem is that i can only reach the DNS server by the domain associate to the primary Private IP address.
I tried enabling ip forwarding, but it didn’t work, so now i’m looking for other solutions.
Tried to debut this Way, by swapping the domain, and that’s how i figured that only the primary ip adress was working:
Domain2 (route53) -> Elastic IP 1 -> Priv IP 1 (primary) - 172.0.0.10 - OK
Domain1 (route53) -> Elastic IP 2 -> Priv IP 2 (secondary)- 172.0.0.11 - NOK
Domain3 (route53) -> Elastic IP 3 -> Priv IP 3 (secondary) - 172.0.0.12 - NOK
What’s weird is that i tested with an HTTP server instead of DNS, and everything works well.