1

I have most of a dynamic dns set up working. I can manually update the DNS entries using nsupdate and my dhcpd.conf file will attempt to set the DNS entries.

However this fails as I don't have bind running on a standard port, I have unbound running on port 53 so I get the error.

dhcpd: Unable to add forward map from XXX to 192.168.0.19: NOTIMP

which is expected.

What I would like to do is get dhcpd to be able to talk to my bind server on the non standard port.

I have tried

zone myzone. {
   primary 192.168.0.125:5252;
}

and

zone myzone. {
   primary 192.168.0.125 5252;
}

and

zone myzone. {
   primary 192.168.0.125;
   port 5252;
}

None of which seem to work.

is there a way to specify a port for the DNS server?

I am updating on the same machine so I'm not using zone files, but I know the updates can work if on the correct port because of testing with nsupdate.

2
  • 1
    AFAIK you can't really instruct DNS clients to use a non standard port. The easiest work around is I can think of is to add a second ip-address to your server and bind unbound to one and bind to a second – HBruijn Nov 14 '13 at 21:19
  • 1
    That is the route I am going down. I have dug into the code and it seems hard coded to port 53. – Jeremy French Nov 15 '13 at 0:02
1

You are not detailing your OS so I'm assuming Linux.

dhcpd does not appear to have an option or parameter for customizing the ddns server port, at least it's not in any man page I have seen.

An option therefore could be to use iptables (or whatever firewall you have) to rewrite outbound packets to your dns server udp/53 or tcp/53, to the port it is really listening on.

An answer on how to do that is provided in this question on Stackoverflow: https://stackoverflow.com/questions/242772/using-iptables-to-change-a-destination-port

It is possible you could fine-grain it even further by only rewriting outbound packets from processes owned by the particular user running your dhcpd process. This is apparently possible using the iptables --uid-owner directive.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.