I have a bind9 DNS server that I have configured to run in port 55 but I can't get the setup working. The server is works fine but I can't tune my local machine to resolve nameserver queries from, port 55


dig -p 55 a1.mylocalinstance.dip
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 2

;a1.mylocalinstance.dip.        IN  A

a1.mylocalinstance.dip. 10800   IN  A

mylocalinstance.dip.    10800   IN  NS  ns.mylocalinstance.dip.

 ns.mylocalinstance.dip.    10800   IN  A

;; Query time: 0 msec
;; WHEN: Fri Dec 18 00:20:54 EET 2015
;; MSG SIZE  rcvd: 96

When I try to ssh at my server:

$ssh test@a1.mylocalinstance.dip
ssh: Could not resolve hostname a1.mylocalinstance.dip: Name or service not known

My /etc/resolv.conf file:

nameserver []:55
nameserver fe80::1%wlan0

I don't understand the relations-dependencies between the network manager and the resolver and how to get things working with bind in my port and how can I forward my dns queries at port 55.

  • 1
    I have never seen any OS (and I've used quite a few) that will allow you to specify the port for DNS resolution. they will likely try both TCP and UDP, but always on port 53. about the best you can do, is use IP tables to redirect traffic from UDP\53 to UDP\55. see any example of port redirection here: cyberciti.biz/faq/linux-port-redirection-with-iptables Ultimately however, I believe you are chasing an untamed ornithoid without cause. Per the resolv.conf man page, a colon in nameserver will cause it to believe that its an IPv6 address. linux.die.net/man/5/resolv.conf Dec 17, 2015 at 23:46
  • @FrankThomas Will another service be able to bind in port 53? That's the whole reason for migrating to port 55 in the first place. I find it absurd that there is not such functionality Dec 18, 2015 at 10:45
  • No, port redirection would leave the redirected port inaccessible. Dec 18, 2015 at 15:41
  • The problem with changing this well-known port is you cannot create a reachable authoritative DNS server doing this. There is no way in the protocol to tell other nameservers that the port to use is anything other than 53. You could consider it a deficeincy, but it's never been needed in practice. There is a cleaner way to achieve what you want.
    – milli
    Jan 3, 2016 at 6:13

2 Answers 2


You haven't explained what is wrong with port 53, If it is already in use, you might try to set the bind9 DNS server at port 53 of another local address, say That is, I haven't tested that.

As an aside, I think that some OSs, perhaps MAC, can be set to also read a port, say 55, in resolv.conf, or their equivalent.


Keep in mind that port 53 is the destination port (of the DNS server), whether it's on the local machine or elsewhere. About the only option you have to connect to a DNS server on port 55 would be to use an iptables command. As long as /etc/resolv.conf points to another machine, any other service can run on port 53 of the local box (though you'd need to be root to run it and I can't think of a good reason to do so).

NetManger reads a config file (in Debian variants /etc/network/interfaces) and writes the /etc/resolv.conf file when it's started (normally, at boot). In other words, NetworkManager is just a program that writes the config files used by other programs and/or calls the programs/scripts to employ those config files.

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.