Linux – Bind on different port with linux

binddnslinuxnetworkingresolv.conf

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 127.0.0.1, port 55

Example:

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

;; QUESTION SECTION:
;a1.mylocalinstance.dip.        IN  A

;; ANSWER SECTION:
a1.mylocalinstance.dip. 10800   IN  A   192.168.1.107

;; AUTHORITY SECTION:
mylocalinstance.dip.    10800   IN  NS  ns.mylocalinstance.dip.

;; ADDITIONAL SECTION:
 ns.mylocalinstance.dip.    10800   IN  A   192.168.1.100

;; Query time: 0 msec
;; SERVER: 127.0.0.1#55(127.0.0.1)
;; 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 [127.0.0.1]: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.

Best Answer

You haven't explained what is wrong with port 53, 127.0.0.1:53. If it is already in use, you might try to set the bind9 DNS server at port 53 of another local address, say 127.0.0.53. That is, 127.0.0.53:53. 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.

Related Question