First, add "wins" to the end of your hosts: line in /etc/nsswitch.conf.
Second, run apt-get install winbind.
This will allow your DNS to resolve "windows" network-neighborhood style machine names (Samba, SMB, Network Name Resolution)
Showing posts with label DNS. Show all posts
Showing posts with label DNS. Show all posts
Thursday, July 19, 2007
Wednesday, December 6, 2006
Fixing rndc error with bind9
While setting up DNS on Pericles I did run into one snag:
rndc: connect failed: connection refused
The first thing to know, is that in Ubuntu Server's default setup, the /var/log/syslog file contains errors relating to bind and rndc startup. I watched this file and found some syntax errors as I tried to resolve this problem, and I recomend you do the same. Here is my solution:
Careful, this will overwrite your rndc.conf (run this while in the /etc/bind folder):
Open the new rndc.conf. First, take the hyphen out of all the rndc-key names. I don't know why. rndckey is what I ended up needing. I think maybe bind9 removed support for the hyphen in these names, but rndc-confgen didn't know it.
Now, copy the bottom section (the commented out part) out, we're going to paste it into the top of named.conf.local, and uncomment it. Save changes to rndc.conf, and after pasting the other section into named.conf.local change the part inside the allow { } to localhost; instead of 127.0.0.1, for similar reason as before it seems to want a name instead of a hardcoded IP in this version.
I killed the named process then tried starting it again, and once again. I found an error in my syntax by looking at /var/log/syslog, and after fixing this it worked without any error.
rndc: connect failed: connection refused
The first thing to know, is that in Ubuntu Server's default setup, the /var/log/syslog file contains errors relating to bind and rndc startup. I watched this file and found some syntax errors as I tried to resolve this problem, and I recomend you do the same. Here is my solution:
Careful, this will overwrite your rndc.conf (run this while in the /etc/bind folder):
rndc-confgen > rndc.conf
Open the new rndc.conf. First, take the hyphen out of all the rndc-key names. I don't know why. rndckey is what I ended up needing. I think maybe bind9 removed support for the hyphen in these names, but rndc-confgen didn't know it.
Now, copy the bottom section (the commented out part) out, we're going to paste it into the top of named.conf.local, and uncomment it. Save changes to rndc.conf, and after pasting the other section into named.conf.local change the part inside the allow { } to localhost; instead of 127.0.0.1, for similar reason as before it seems to want a name instead of a hardcoded IP in this version.
I killed the named process then tried starting it again, and once again. I found an error in my syntax by looking at /var/log/syslog, and after fixing this it worked without any error.
DNS with bind9 on Ubuntu
I just finished setting up bind on Pericles, and it wasn't too bad.
Bind was already installed by using the LAMP option on the Ubuntu Server disc. The configuration files for it are found in /etc/bind. I have a tool written as a Windows console application that dynamically cranks out my forward files for me based on templates, so I ported that over and ran it with wineconsole. It worked. I had to make a change in the named.conf.local file because for some reason bind on Linux seems to require a full path in the zone lines:
On windows, I didn't need /etc/bind/ prefixing those, because the paths were relative to the conf file. No big deal, however--it was an easy change.
I dropped a script into /usr/local/sbin called redns
It does the following:
This simply stops bind, regenerates the forward files using my tool (the dnsgen.sh file launches it with wineconsole), and then starts up bind again.
If you get an rndc error, here's how I fixed it.
I will port the dnsgen tool over to a native application at some future point, but I'm in a hurry right now because my WAMP server is starting to have MySQL blackouts requiring a reboot. It seems to be something to do with a file handle getting a lock stuck on it, because stopping and starting the MySQL daemon doesn't improve the situation.
Bind was already installed by using the LAMP option on the Ubuntu Server disc. The configuration files for it are found in /etc/bind. I have a tool written as a Windows console application that dynamically cranks out my forward files for me based on templates, so I ported that over and ran it with wineconsole. It worked. I had to make a change in the named.conf.local file because for some reason bind on Linux seems to require a full path in the zone lines:
zone "whatever.tld" IN { type master; file "/etc/bind/forward/whatever.tld.zone"; };On windows, I didn't need /etc/bind/ prefixing those, because the paths were relative to the conf file. No big deal, however--it was an easy change.
I dropped a script into /usr/local/sbin called redns
It does the following:
/etc/init.d/bind9 stop
/usr/local/sbin/dnsgen.sh
/etc/init.d/bind9 start
This simply stops bind, regenerates the forward files using my tool (the dnsgen.sh file launches it with wineconsole), and then starts up bind again.
If you get an rndc error, here's how I fixed it.
I will port the dnsgen tool over to a native application at some future point, but I'm in a hurry right now because my WAMP server is starting to have MySQL blackouts requiring a reboot. It seems to be something to do with a file handle getting a lock stuck on it, because stopping and starting the MySQL daemon doesn't improve the situation.
Subscribe to:
Posts (Atom)