Sunday, August 13, 2006

OpenBSD, bind, NAT & aliased IPs

Yay for routing and NAT. Not.

I'm using RollerNet for my secondary DNS. Works quite nicely most of the time, but hey it's free. The DNS logs at rollernet showed

zone refused notify from non-master:

Hmmm, yeah, is on, which is an alias on my outside interface. I'm not serving requests on .188. ok, so bind just hands the notify to the OS, which does its thing and sends out the notify via the default route. Only, that happens to not be the master in the bind config at RollerNet.

I like my setup, so let's just reverse the assignment of IP and alias. Long story short, PF doesn't allow NAT on an aliased IP. I couldn't get it to rewrite outbound traffic for the RollerNet name servers to come from .215. Nor could I convince bind to use .215.

After some fussing with configs and options, I eventually changed the bind config to listen on .188, and changed RollerNet to take .188 as the master. Since that looks ugly in the config, I'm migrating the DNS entry for from .215 to .188. Along the way I fixed bind and PF configs to use the new IP.

Hah, apparently didn't notice the change in the configuration yet. It's still refusing notifies from .188, while already happily serves the updated zone. I'll wait some time before I stop serving DNS on .215.

Update: came around to update as well 15 minutes later. All is good now.