# BSD 7.2 named start failure



## gnoma (Feb 7, 2010)

I am trying to run a second DNS server and I copy the named.conf from the first one (wich is working fine so far) and change the rndc-key by generating a new one and I change the host name.
Also I copy the firewall.rules and all zone lookup files.
But the problem is....

```
ns# /etc/rc.d/named start
Starting named.
ns# /etc/rc.d/named stop
named not running? (check /var/run/named/pid).
ns# /etc/rc.d/named start
Starting named.
ns# /etc/rc.d/named restart
named not running? (check /var/run/named/pid).
Starting named.
ns# /etc/rc.d/named start
Starting named.
```
As you can see, I can't get it start.
Anybody knows how to fix this ??? Had the same problem?
Thanks


----------



## Alt (Feb 7, 2010)

Look the logs xD


----------



## gnoma (Feb 7, 2010)

The logs are empty, ivent the log files are not created


----------



## Alt (Feb 7, 2010)

Show /etc/rc.conf then


----------



## J65nko (Feb 7, 2010)

Does a /var/run/named/pid file exist? 
If there such a file remove it:

```
# rm /var/named/pid
```


----------



## SirDice (Feb 8, 2010)

Look in /var/log/messages.


----------



## gnoma (Feb 8, 2010)

rc.conf:

```
linux_enable="YES"
sshd_enable="YES"
ifconfig_em0="inet my-IP netmask my-net-mask"
defaultrouter="my-router"
hostname="ns.example.bg"
firewall_enable="YES"
firewall_type="/usr/local/etc/firewall.rules"
firewall_flags="-p cpp"
named_enable="YES"              # Run named, the DNS server (or NO).
named_program="/usr/sbin/named" # path to named, if you want a different one.
mamed_flags="-u bind"           # Flags for named
named_pidfile="/var/run/named/pid" # Must set this in named.conf as well
named_chrootdir="/var/named"    # Chroot directory (or "" not to auto-chroot it)
named_chroot_autoupdate="YES"   # Automatically install/update chrooted
                                # components of named. See /etc/rc.d/named.
named_symlink_enable="YES"      # Symlink the chrooted pid file
```
There is no file /var/named/pid and no file /var/run/named/pid

And in /var/log/messages are only 2-3 user logon and ask for su messages. Nothing about named

```
ns# cd /var/run/named/
ns# ls
ns# /etc/rc.d/named start
Starting named.
ns# ls
ns# /etc/rc.d/named start
Starting named.
ns# ls
ns# /etc/rc.d/named stop
named not running? (check /var/run/named/pid).
```


----------



## Alt (Feb 8, 2010)

Try comment out named_program="/usr/sbin/named" in rc.conf
Try look for logs in /var/named/var/log/


----------



## gnoma (Feb 8, 2010)

I comment this line and it is still the same and the dir /var/named/var/log/  is empy
Today I jusr reinstall FreeBSD and tryed to run namedb again with the same settings and it still does the same thing


----------



## SirDice (Feb 8, 2010)

I'm starting to sound like a broken record... Check /var/log/messages.


----------



## gnoma (Feb 8, 2010)

```
Feb  8 17:13:22 ns named[1767]: starting BIND 9.4.3-P2 -t /var/named -u bind
Feb  8 17:13:22 ns named[1767]: could not get query source dispatcher (0.0.0.0#53)
Feb  8 17:13:22 ns named[1767]: loading configuration: address in use
Feb  8 17:13:22 ns named[1767]: exiting (due to fatal error)
Feb  8 17:13:24 ns named[1830]: starting BIND 9.4.3-P2 -t /var/named -u bind
Feb  8 17:13:24 ns named[1830]: could not get query source dispatcher (0.0.0.0#53)
Feb  8 17:13:24 ns named[1830]: loading configuration: address in use
Feb  8 17:13:24 ns named[1830]: exiting (due to fatal error)
```
lol.. no idea what this is!


----------



## SirDice (Feb 8, 2010)

gnoma said:
			
		

> lol.. no idea what this is!


The reason it's not working. There's already something listening on port 53. Check with [cmd=]sockstat[/cmd].


----------



## gnoma (Feb 8, 2010)

looks like nothing's on 53 

```
USER     COMMAND    PID   FD PROTO  LOCAL ADDRESS         FOREIGN ADDRESS
k_georgievsshd      813   3  tcp4   92.247.11.106:22      92.247.11.99:48913
k_georgievsshd      813   4  stream -> ??
root     sshd       810   3  tcp4   92.247.11.106:22      92.247.11.99:48913
root     sshd       810   5  stream -> ??
root     inetd      769   5  tcp4   *:21                  *:*
smmsp    sendmail   744   3  dgram  -> /var/run/log
root     sendmail   740   3  tcp4   127.0.0.1:25          *:*
root     sendmail   740   4  dgram  -> /var/run/logpriv
root     sshd       734   3  tcp6   *:22                  *:*
root     sshd       734   4  tcp4   *:22                  *:*
root     syslogd    549   4  dgram  /var/run/log
root     syslogd    549   5  dgram  /var/run/logpriv
root     syslogd    549   6  dgram  /var/run/log
root     syslogd    549   7  dgram  /var/named/var/run/log
root     syslogd    549   8  udp6   *:514                 *:*
root     syslogd    549   9  udp4   *:514                 *:*
root     devd       476   4  stream /var/run/devd.pipe
```

and the firewall...
/usr/local/etc/firewall.rules


looks fine about :53


----------



## SirDice (Feb 8, 2010)

Wait a few seconds before restarting bind. It may not have released the port yet.


----------



## gnoma (Feb 8, 2010)

hmm that's strange...
after some google-ing... check this out http://www.linuxhomenetworking.com/forums/showthread.php/18779-DNS-broken-after-Fedora-10-upgrade


> I commented out this and it looks like it's working:
> 
> 
> Code:
> ...


And that's what I did:

```
options {
        directory       "/etc/namedb";
        allow-recursion { trusted; };
        pid-file        "/var/run/named/pid";
        dump-file       "/var/dump/named_dump.db";
        statistics-file "/var/stats/named.stats";
        version         "DeltaNews Primary DNS Server";
        listen-on       { 127.0.0.1; 92.247.11.105; 92.247.11.106;};
        hostname        "ns.deltanews.bg";
//      query-source address * port 53;
```
and it is runing just fine now
Thanks SirDice you've been very helpful


----------

