Repairing Ubuntu 9.04 DNS

by mike on June 10, 2009

Ubuntu 9.04 DNS will probably be broken on install.  However, the fix is simple enough.  The problem relates to rndc which is the command program used to control Bind9.  Here are two tests you can do to verify that it is the exact same problem.

Test #1: rndc Failure
The test shows that rndc cannot load and listen on port 953.  Because it is tied to the localhost you see the 127.0.0.1. The connection is refused because it is not listening.

# /etc/init.d/bind9 restart
* Stopping domain name service… bind9                      rndc: connect failed: 127.0.0.1#953: connection refused
[ OK ]
* Starting domain name service… bind9                                                      [fail]

Test #2: Are you listening on port 953?
Here you can see clearly that port 953 is not listening.

# netstat -aunt
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 0.0.0.0:993             0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:995             0.0.0.0:*               LISTEN
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:110             0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:143             0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:2000            0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN
tcp        0      0 192.168.5.104:22        192.168.5.100:56924     ESTABLISHED
tcp6       0      0 :::22                   :::*                    LISTEN
udp        0      0 0.0.0.0:68              0.0.0.0:*

After the problem is fixed, now you can see that port 953 is indeed listening.
# netstat -aunt
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 0.0.0.0:993             0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:995             0.0.0.0:*               LISTEN
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:110             0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:143             0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:2000            0.0.0.0:*               LISTEN
tcp        0      0 192.168.5.104:53        0.0.0.0:*               LISTEN
tcp        0      0 127.0.0.1:53            0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN
tcp        0      0 127.0.0.1:953           0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN
tcp        0      0 192.168.5.104:22        192.168.5.100:56924     ESTABLISHED
tcp6       0      0 :::53                   :::*                    LISTEN
tcp6       0      0 :::22                   :::*                    LISTEN
udp        0      0 192.168.5.104:53        0.0.0.0:*
udp        0      0 127.0.0.1:53            0.0.0.0:*
udp        0      0 0.0.0.0:68              0.0.0.0:*
udp6       0      0 :::53                   :::*

The Solution
Add this to /etc/bind/named.conf in order for rndc to work:

include “/etc/bind/rndc.key”;

controls {
inet 127.0.0.1 port 953
allow { 127.0.0.1; } keys { “rndc-key”; };
};

Now restart with:

/etc/init.d/bind9 restart

  • Share/Bookmark

{ 1 trackback }

Problems receiving mail with Zimbra - Zimbra - Forums
July 26, 2009 at 11:14 am

{ 2 comments… read them below or add one }

Micah November 14, 2009 at 8:04 pm

Make sure the loopback device is installed correctly.

Stanley December 5, 2009 at 9:19 pm

I am still getting the error.

Leave a Comment

Previous post:

Next post: