Given a public /24 prefix, announced via BGP, 192.0.2.0/24. I have split this prefix into various smaller networks. I would like to use 1-2 servers for the DNS server (forward and reverse) which needs a static IP. Since this IP needs to go as NS record into the parent zone, changing IP is not simple (and requires support of the admin of 2.0.192.in-addr.arpa).
The various networks are connected to each other via p2p links/tunnels and OSPF. One such network is 192.0.2.208/28 and I would like to use 192.0.2.212 as DNS server. The DNS server will be a virtual machine and I would like to have the flexibility to move it to another network at a different location, say 192.0.2.234 in 192.0.2.232/29. Normally this requires not only changing the IP but also coordinating with the owner of 2.0.192.in-addr.arpa on the NS record update.
I was thinking of picking a /32 address from the prefix, say 192.0.2.255/32. This address could then be assigned to a dummy device or as a second IP. But unless the DNS server becomes a router (and/or runs OSPF too) I need to deal with static routing which sounds like a hassle too.
What is the best solution for this scenario? Nearly any other service can be addresses via DNS, so the IP itself is not as critical. But for a DNS server it is.
The preferred method for doing such things is running your DNS server on Virtual IP supported by VRRP (keepalived) or CARP (ucarp). However, this will work within common broadcast domain only.
If you don't want to deal with OSPF or static routing on a server but still want it to roam between subnets you can use some sort of tunneling between the server and border router, i.e. use L2TP and use /32 assigned to tun0 as DNS server address.