1

I've been reading a bit on how to configure my own DNS server. I have a host of questions but this is the first that came up:

  1. I edited /etc/named.conf and created the appropriate zone files.
  2. I tried to restart bind9 with a service bind9 restart.
  3. A quick grep of syslog shows that it's not running with the changes I specified in /etc/named.conf.

How do I get /etc/named.conf to be loaded?

(I gave up after a while and after looking at the output from named-checkconf -p, I started editing files in /var/cache/bind as well as /etc/bind/)

Son of the Wai-Pan
  • 757
  • 4
  • 11
  • 25
  • Are there any configuration files in `/etc/named/`? – Ladadadada Jun 21 '12 at 05:47
  • There's no such directory. So the answer is no. I /did/ create a directory called `/var/named/` as root and then referenced that path in the options of the named.conf file, but that didn't help. – Son of the Wai-Pan Jun 21 '12 at 05:57
  • 1
    Aren't you supposed to use /etc/bind on ubuntu?.. – pauska Jun 21 '12 at 05:58
  • Maybe you installed named with chroot and configs are in /var/named/chroot/etc – B14D3 Jun 21 '12 at 05:58
  • @pauska Quite possibly but where's the documentation for that? That's the frustrating part because I do a `man named` and there's nothing there about using `/etc/bind`. – Son of the Wai-Pan Jun 21 '12 at 06:01
  • @AveryChan https://help.ubuntu.com/community/BIND9ServerHowto – pauska Jun 21 '12 at 06:02
  • @pauska Thanks! Sigh. I needed this two hours ago. :) – Son of the Wai-Pan Jun 21 '12 at 06:05
  • Are there any interesting error messages in your logs (/var/log/syslog). Is there anything interesting in the output of /usr/sbin/named -g ? – user9517 Jun 21 '12 at 06:17
  • @AveryChan, When you installed bind, you didn't install a packaged called named did you, you installed a packaged called bind. So the obvious first choice to look for package configs would be `/etc/{packagename}`. You could also run a command like this. `dpkg --listfiles bind9 | grep /etc`. You could have also done something like `find /etc -name '*named.conf*'`. – Zoredache Jun 21 '12 at 08:06
  • @Zoredache bind was part of the default install. The `dpkg` command didn't display anything, but the `find` command was helpful. Thanks. – Son of the Wai-Pan Jun 22 '12 at 02:36

2 Answers2

1

Running service bind9 restart should work. For bind9 on Ubuntu v11.10, the default location for named.conf is /etc/bind/named.conf not /etc/named.conf.

In general, the init script (/etc/init.d/bind9) should point you to where the configuration file resides.

For bind9 on Ubuntu v11.10, there is a bind settings file at /etc/default/bind9 but it is only used to set command line options when starting named - which shouldn't matter, unless someone edited this file to add an argument to redirect where named.conf resides.

NOTE: I wouldn't move the configuration file away from its default location without good reason nor would I edit what is in /var/named directly (isn't this autocreated).

Another thing to check is: have you tried service bind9 stop and then confirmed that named is no longer running and then started (with service bind9 start) it again?

wullxz
  • 1,073
  • 2
  • 16
  • 29
Lars Nordin
  • 334
  • 2
  • 8
0

Yeah. I have noticed that the named man page is completely wrong on ubuntu 10.04 about the config file. It seems to actually be /etc/bind/named.conf rather than what the man page states (/etc/named.conf). I figured this out by reading the system log when bind9 starts and noticing that it was built with sysconfdir=/etc/bind

I hope someone notices the error and fixes in at some point.