LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   failed to query a zone (nsd3) (https://www.linuxquestions.org/questions/linux-server-73/failed-to-query-a-zone-nsd3-868216/)

malayo 03-12-2011 08:06 PM

failed to query a zone (nsd3)
 
I tried playing with nsd3 on Debian 5 to create a light-weight nameserver on my cheaply vps. I found that I could not query the zone created with host even after i had pointed nameserver to localhost/127.0.0.1 in resolv.conf (querying from within the nsd server)

# host thechimchim.com
;; connection timed out; no servers could be reached

/etc/nsd3/nsd.conf

Code:

## NSD authoritative only DNS

server:
        ip-address: 10.10.10.10

        server-count: 1

        ip4-only: yes

        #hide-version: yes

        identity: ""

        zonesdir: "/etc/nsd3"

zone:
        name: thechimchim.com
        zonefile: thechimchim.com.forward

zone:
        name: 10.10.10.in-addr.arpa
        zonefile: thechimchim.com.reverse

/etc/nsd3/thechimchim.com.forward

Code:

;## forward zone - thechimchim.com.forward

$ORIGIN thechimchim.com.
$TTL 86400

@ IN SOA ns1.thechimchim.com. admin.thechimchim.com. (
        2011020701 ; serial no
        28800 ; refresh
        7200 ; retry
        86400 ; expire
        86400 ; min TTL
        )

        NS        ns1.thechimchim.com.
        MX        10 mail.thechimchim.com.

ns1        IN        A        10.10.10.10
mail        IN        A        10.10.10.10
*        IN        A        10.10.10.10

/etc/nsd3/thechimchim.com.reverse
Code:

;## REVERSE zone - thechimchim.com.reverse

$ORIGIN thechimchim.com.
$TTL 86400

10.10.10.in-addr.arpa. IN SOA ns1.thechimchim.com. admin.thechimchim.com. (
        2011020701 ; serial
        28800 ; refresh
        7200 ; retry
        864000 ; expire
        86400 ; TTL
        )

10.10.10.10.in-addr.arpa. IN        PTR ns1
10.10.10.10.in-addr.arpa. IN        PTR mail

when i rebuild nsdc db and reload nsdc, it says nsd not running

Noway2 03-13-2011 03:36 PM

I haven't used nsd3, so my advice is somewhat generic. Off hand, I don' see anything obviously wrong in your zones files. You probably have a subtle syntax error in one of the configuration files. Sometimes when this happens, attempting to start the service does not cause output to stderr or stdout. Instead you need to look in the log files. Try syslog or messages unless nsd3 has its own log file, which would the first place to look. If the errors are obscure, putting the error message, or part of it, into Google with quotes can be helpful.

malayo 03-14-2011 12:54 AM

Quote:

Originally Posted by Noway2 (Post 4289509)
I haven't used nsd3, so my advice is somewhat generic. Off hand, I don' see anything obviously wrong in your zones files. You probably have a subtle syntax error in one of the configuration files. Sometimes when this happens, attempting to start the service does not cause output to stderr or stdout. Instead you need to look in the log files. Try syslog or messages unless nsd3 has its own log file, which would the first place to look. If the errors are obscure, putting the error message, or part of it, into Google with quotes can be helpful.

hi, i set
logfile: "/var/log/nsd3.log" in server section in nsd.conf and got below messages in nsd3.log when i restarted nsd3

Code:

[1300081686] nsd[2649]: error: can't bind the socket: Cannot assign requested address
[1300081698] nsd[2705]: error: can't bind the socket: Cannot assign requested address

but googling doesn't give me any answer

Noway2 03-14-2011 04:13 AM

There are a couple of things that I can think of that can cause this problem:
  • attempting to assign an IP address not associated with the NIC
  • insufficient permissions
  • An bug in the application
  • the port already being in use

First, your post references the address of 10.10.10.10. While is is a valid private IP, I assume that it is false for the purposes of this post. Are you using the address of the NIC card in your configuration? If you have this behind a router, it will be the LAN IP, not your public IP.
Second, have you tried starting the application as root? Only a root owned process can open low numbered ports.
Third, perform a "netstat -pnl | grep 53" The p flag will list the process, n will give numeric output and l will show listening ports. This should be run as root / sudo and will tell you if something is already occupying the port. DNS will operate on UDP port 53.

You can also try setting the IP address to bind to in your configuration file to something like 127.0.0.1 or * to see if that helps. I agree that Googling for that error message with quotes isn't returning any hits and without it is giving generic ones. This is potentially a good sign that this ins't a common bug in the program.

Lastly, are there any other error entries in the log that could indicate a problem, like being unable to open a PID file or a log file not existing?

malayo 03-15-2011 09:04 AM

thanks noway2, the problem is that there's a bind service that is still running even after i removed it. After i stopped it, then i could start nsd3 service and successfully run nsdc reload


All times are GMT -5. The time now is 10:10 AM.