# [SOLVED] Reverse DNS lookups with djbdns

## Bachus

Hi,

Today I've setup djbdns to serve a zone. All works fabulously exept for reverse lookups. For reasons unknown 'dig @192.168.2.11 -x 192.168.2.15' won't give me a hostname :s

This is my 'data' file:

```
.hethuis.wanadoo.nl:192.168.2.11:a:259200

.2.168.192.in-addr.arpa:192.168.2.11:a:259200

=rt02.hethuis.wanadoo.nl:192.168.1.1:86400

+livebox.hethuis.wanadoo.nl:192.168.1.1:86400

=rt01.hethuis.wanadoo.nl:192.168.2.1:86400

+valinor.hethuis.wanadoo.nl:192.168.2.1:86400

+linksys-wrt54g.hethuis.wanadoo.nl:192.168.2.1:86400

+wireless.hethuis.wanadoo.nl:192.168.2.1:86400

=pc01-frans.hethuis.wanadoo.nl:192.168.2.11:86400

&11.2.168.1.in-addr.arpa:192.168.2.11:a:259200

.11.2.168.1.in-addr.arpa:192.168.2.11:a:259200

+ns1.hethuis.wanadoo.nl:192.168.2.11:86400

+ftp.hethuis.wanadoo.nl:192.168.2.11:86400

+hethuis.wanadoo.nl:192.168.2.11:86400

=lt01-robert.hethuis.wanadoo.nl:192.168.2.12:86400

&12.2.168.1.in-addr.arpa:192.168.2.11:a:259200

.12.2.168.1.in-addr.arpa:192.168.2.11:a:259200

=pc01-jeroen.hethuis.wanadoo.nl:192.168.2.14:86400

&14.2.168.192.in-addr.arpa:192.168.2.11:a:259200

.14.2.168.192.in-addr.arpa:192.168.2.11:a:259200

=lt01-jeroen.hethuis.wanadoo.nl:192.168.2.15:86400

&15.2.168.192.in-addr.arpa:192.168.2.11:a:259200

.15.2.168.192.in-addr.arpa:192.168.2.11:a:259200
```

This should be right, or doesn't it?

Thanks in advanceLast edited by Bachus on Tue Aug 15, 2006 2:42 pm; edited 1 time in total

----------

## darkphader

 *Bachus wrote:*   

> This is my 'data' file:
> 
> ```
> .hethuis.wanadoo.nl:192.168.2.11:a:259200
> 
> ...

 

I don't have any of these entries in my data file:

```
&11.2.168.1.in-addr.arpa:192.168.2.11:a:259200

.11.2.168.1.in-addr.arpa:192.168.2.11:a:259200

&12.2.168.1.in-addr.arpa:192.168.2.11:a:259200

.12.2.168.1.in-addr.arpa:192.168.2.11:a:259200

&14.2.168.192.in-addr.arpa:192.168.2.11:a:259200

.14.2.168.192.in-addr.arpa:192.168.2.11:a:259200

&15.2.168.192.in-addr.arpa:192.168.2.11:a:259200

.15.2.168.192.in-addr.arpa:192.168.2.11:a:259200
```

 and all works as expected.

Chris

----------

## Bachus

Hmm strange. .... I removed those lines and did 'make' and '/etc/init.d/svscan restart'.... still no reverse lookup..

Dig says something like this:

```
[Lothlorien 15:54 /service/tinydns/root] > dig @192.168.2.11 -x 192.168.2.14

; <<>> DiG 9.3.2 <<>> @192.168.2.11 -x 192.168.2.14

; (1 server found)

;; global options:  printcmd

;; Got answer:

;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 61291

;; flags: qr aa rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:

;14.2.168.192.in-addr.arpa.     IN      PTR

;; Query time: 3290 msec

;; SERVER: 192.168.2.11#53(192.168.2.11)

;; WHEN: Tue Aug 15 15:55:06 2006

;; MSG SIZE  rcvd: 43
```

There should be an answer section

nslookup (I know it's deprecated) says this:

```
[Lothlorien 15:55 /service/tinydns/root] > nslookup

> server 192.168.2.11

Default server: 192.168.2.11

Address: 192.168.2.11#53

> 192.168.2.14

Server:         192.168.2.11

Address:        192.168.2.11#53

** server can't find 14.2.168.192.in-addr.arpa: NXDOMAIN

>
```

That isn't right either :s

What should I do to get reversed lookups working?

----------

## Bachus

Fixed it...

...I'de forgotten to let dnscachex point to the tinydns server for the 2.168.192.in-addr.arpa domain   :Embarassed: 

```
echo 127.0.0.1 > /var/dnscachex/root/servers/2.168.192.in-addr.arpa
```

fixed the problem

----------

