# Problem with BIND not resolving DNS.

## arthurzap

Hello all.

I installed bind here to serve as a DNS resolver for my local network and DNS server to host my domain.

DNS resolve is not working. Here's my config:

named.conf

```

options {

        directory "/var/bind";

        // uncomment the following lines to turn on DNS forwarding,

        // and change the forwarding ip address(es) :

        //forward first;

        //forwarders {

        //      123.123.123.123;

        //      123.123.123.123;

        //};

        //listen-on-v6 { none; };

        //listen-on { 127.0.0.1; };

        // to allow only specific hosts to use the DNS server:

        //allow-query {

        //      127.0.0.1;

        //};

        // if you have problems and are behind a firewall:

        //query-source address * port 53;

        pid-file "/var/run/named/named.pid";

};

// Briefly, a zone which has been declared delegation-only will be effectively

// limited to containing NS RRs for subdomains, but no actual data beyond its

// own apex (for example, its SOA RR and apex NS RRset). This can be used to

// filter out "wildcard" or "synthesized" data from NAT boxes or from

// authoritative name servers whose undelegated (in-zone) data is of no

// interest.

// See http://www.isc.org/products/BIND/delegation-only.html for more info

//zone "COM" { type delegation-only; };

//zone "NET" { type delegation-only; };

zone "." IN {

        type hint;

        file "named.ca";

};

zone "localhost" IN {

        type master;

        file "pri/localhost.zone";

        allow-update { none; };

        notify no;

};

zone "127.in-addr.arpa" IN {

        type master;

        file "pri/127.zone";

        allow-update { none; };

        notify no;

};

zone "caraguanet.com.br" {

        type master;

        file "pri/caraguanet.zone";

        allow-update { none; };

        notify no;

};

zone "caraguatatuba.sp.gov.br" {

        type slave;

        file "sec/caraguatatuba.zone";

        masters {

            200.178.161.2;

        };

};

zone "190.206.200.in-addr.arpa" {

        type master;

        file "pri/caraguanet.rev";

};

zone "0.168.192.in-addr.arpa" {

        type master;

        file "pri/192.168.0.rev";

        allow-update { none; };

        notify no;

};

logging {

  channel default_file { file "/var/log/named/default.log" versions 3 size 5m; severity dynamic; print-time yes; };

  channel general_file { file "/var/log/named/general.log" versions 3 size 5m; severity dynamic; print-time yes; };

  channel database_file { file "/var/log/named/database.log" versions 3 size 5m; severity dynamic; print-time yes; };

  channel security_file { file "/var/log/named/security.log" versions 3 size 5m; severity dynamic; print-time yes; };

  channel config_file { file "/var/log/named/config.log" versions 3 size 5m; severity dynamic; print-time yes; };

  channel resolver_file { file "/var/log/named/resolver.log" versions 3 size 5m; severity dynamic; print-time yes; };

  channel xfer-in_file { file "/var/log/named/xfer-in.log" versions 3 size 5m; severity dynamic; print-time yes; };

  channel xfer-out_file { file "/var/log/named/xfer-out.log" versions 3 size 5m; severity dynamic; print-time yes; };

  channel notify_file { file "/var/log/named/notify.log" versions 3 size 5m; severity dynamic; print-time yes; };

  channel client_file { file "/var/log/named/client.log" versions 3 size 5m; severity dynamic; print-time yes; };

  channel unmatched_file { file "/var/log/named/unmatched.log" versions 3 size 5m; severity dynamic; print-time yes; };

  channel queries_file { file "/var/log/named/queries.log" versions 3 size 5m; severity dynamic; print-time yes; };

  channel network_file { file "/var/log/named/network.log" versions 3 size 5m; severity dynamic; print-time yes; };

  channel update_file { file "/var/log/named/update.log" versions 3 size 5m; severity dynamic; print-time yes; };

  channel dispatch_file { file "/var/log/named/dispatch.log" versions 3 size 5m; severity dynamic; print-time yes; };

  channel dnssec_file { file "/var/log/named/dnssec.log" versions 3 size 5m; severity dynamic; print-time yes; };

  channel lame-servers_file { file "/var/log/named/lame-servers.log" versions 3 size 5m; severity dynamic; print-time yes; };

  category default { default_file; };

  category general { general_file; };

  category database { database_file; };

  category security { security_file; };

  category config { config_file; };

  category resolver { resolver_file; };

  category xfer-in { xfer-in_file; };

  category xfer-out { xfer-out_file; };

  category notify { notify_file; };

  category client { client_file; };

  category unmatched { unmatched_file; };

  category queries { queries_file; };

  category network { network_file; };

  category update { update_file; };

  category dispatch { dispatch_file; };

  category dnssec { dnssec_file; };

  category lame-servers { lame-servers_file; };

}; 

```

caraguanet.zone

```

$TTL 1W

@                       1D IN SOA       caraguanet.com.br. root.caraguanet.com.br. (

                                        2005063002      ; serial

                                        3H              ; refresh

                                        15M             ; retry

                                        1W              ; expiry

                                        1D )            ; minimum

@                       1D IN NS        web.caraguanet.com.br.

*                       1D IN PTR       localhost.

@                       IN NS           dns.caraguatatuba.sp.gov.br.

@                       IN MX 5         smtp.caraguanet.com.br.

@                       IN A            200.206.190.252

dns                     IN CNAME        @

www                     IN CNAME        @

ftp                     IN CNAME        @

smtp                    IN CNAME        @

pop                     IN CNAME        @

pop3                    IN CNAME        @

dev                     IN CNAME        @

srv1                    IN CNAME        @

numerador               IN CNAME        @

acessasp                IN CNAME        @

mail                    IN A            192.168.0.3

webmail                 IN CNAME        @

qmailadmin              IN A            192.168.0.3

```

caraguanet.rev

```

$TTL 1W

@                       1D IN SOA       mail.caraguanet.com.br. root.mail.caraguanet.com.br. (

                                        2005063002      ; serial

                                        3H              ; refresh

                                        15M             ; retry

                                        1W              ; expiry

                                        1D )            ; minimum

@                       IN NS           web.caraguanet.com.br.

252                     IN PTR          web.caraguanet.com.br.

252                     IN PTR          pop.caraguanet.com.br.

252                     IN PTR          smtp.caraguanet.com.br.

```

127.zone

```

$ORIGIN 127.in-addr.arpa.

$TTL 1W

@              1D IN SOA        localhost. root.localhost. (

                                15     ; Serial

                                3H     ; Refresh

                                15M    ; Retry

                                1W     ; Expiry

                                1D )   ; Minimum

               1D IN NS         localhost.

*              1D IN PTR        localhost. 

```

192.168.0.rev 

```

$TTL 1W

@                       1D IN SOA       mail.caraguanet.com.br. root.mail.caraguanet.com.br. (

                                        2005063002      ; serial

                                        3H              ; refresh

                                        15M             ; retry

                                        1W              ; expiry

                                        1D )            ; minimum

@                       IN NS           web.caraguanet.com.br.

1                       IN PTR          web.caraguanet.com.br.

1                       IN PTR          pop.caraguanet.com.br.

```

caraguatatuba.zone

```

$ORIGIN .

$TTL 3600       ; 1 hour

caraguatatuba.sp.gov.br IN SOA  dns.caraguatatuba.sp.gov.br. root.caraguatatuba.sp.gov.br. (

                                2005063002 ; serial

                                3600       ; refresh (1 hour)

                                3600       ; retry (1 hour)

                                1209600    ; expire (2 weeks)

                                604800     ; minimum (1 week)

                                )

                        NS      ns.embratel.net.br.

                        NS      dns.caraguatatuba.sp.gov.br.

                        NS      srv1.caraguanet.com.br.

                        A       200.178.161.2

                        MX      5 mail.caraguatatuba.sp.gov.br.

$ORIGIN caraguatatuba.sp.gov.br.

acessasp                CNAME   caraguatatuba.sp.gov.br.

dns                     CNAME   caraguatatuba.sp.gov.br.

dns1                    A       200.178.161.3

ftp                     CNAME   caraguatatuba.sp.gov.br.

iptu                    CNAME   caraguatatuba.sp.gov.br.

itbi                    CNAME   caraguatatuba.sp.gov.br.

jogosregionais          CNAME   caraguatatuba.sp.gov.br.

mail                    A       200.178.161.3

pop                     A       200.178.161.3

pop3                    A       200.178.161.3

receita                 CNAME   caraguatatuba.sp.gov.br.

santoantonio            CNAME   caraguatatuba.sp.gov.br.

smtp                    A       200.178.161.3

webmail                 A       200.178.161.3

www                     CNAME   caraguatatuba.sp.gov.br.

```

named.ca

```

;       This file holds the information on root name servers needed to

;       initialize cache of Internet domain name servers

;       (e.g. reference this file in the "cache  .  <file>"

;       configuration file of BIND domain name servers).

;

;       This file is made available by InterNIC 

;       under anonymous FTP as

;           file                /domain/named.cache

;           on server           FTP.INTERNIC.NET

;       -OR-                    RS.INTERNIC.NET

;

;       last update:    Jan 29, 2004

;       related version of root zone:   2004012900

;

;

; formerly NS.INTERNIC.NET

;

.                        3600000  IN  NS    A.ROOT-SERVERS.NET.

A.ROOT-SERVERS.NET.      3600000      A     198.41.0.4

;

; formerly NS1.ISI.EDU

;

.                        3600000      NS    B.ROOT-SERVERS.NET.

B.ROOT-SERVERS.NET.      3600000      A     192.228.79.201

;

; formerly C.PSI.NET

;

.                        3600000      NS    C.ROOT-SERVERS.NET.

C.ROOT-SERVERS.NET.      3600000      A     192.33.4.12

;

; formerly TERP.UMD.EDU

;

.                        3600000      NS    D.ROOT-SERVERS.NET.

D.ROOT-SERVERS.NET.      3600000      A     128.8.10.90

;

; formerly NS.NASA.GOV

;

.                        3600000      NS    E.ROOT-SERVERS.NET.

E.ROOT-SERVERS.NET.      3600000      A     192.203.230.10

;

; formerly NS.ISC.ORG

;

.                        3600000      NS    F.ROOT-SERVERS.NET.

F.ROOT-SERVERS.NET.      3600000      A     192.5.5.241

;

; formerly NS.NIC.DDN.MIL

;

.                        3600000      NS    G.ROOT-SERVERS.NET.

G.ROOT-SERVERS.NET.      3600000      A     192.112.36.4

;

; formerly AOS.ARL.ARMY.MIL

;

.                        3600000      NS    H.ROOT-SERVERS.NET.

H.ROOT-SERVERS.NET.      3600000      A     128.63.2.53

;

; formerly NIC.NORDU.NET

;

.                        3600000      NS    I.ROOT-SERVERS.NET.

I.ROOT-SERVERS.NET.      3600000      A     192.36.148.17

;

; operated by VeriSign, Inc.

;

.                        3600000      NS    J.ROOT-SERVERS.NET.

J.ROOT-SERVERS.NET.      3600000      A     192.58.128.30

;

; operated by RIPE NCC

;

.                        3600000      NS    K.ROOT-SERVERS.NET.

K.ROOT-SERVERS.NET.      3600000      A     193.0.14.129 

;

; operated by ICANN

;

.                        3600000      NS    L.ROOT-SERVERS.NET.

L.ROOT-SERVERS.NET.      3600000      A     198.32.64.12

;

; operated by WIDE

;

.                        3600000      NS    M.ROOT-SERVERS.NET.

M.ROOT-SERVERS.NET.      3600000      A     202.12.27.33

; End of File

```

----------

## nobspangle

Your caraguanet zone file is a mess, there are several problems with missmatched NS records.

Check DNS report for more info www.dnsreport.com

Your PTR zone for caraguanet doesn't work, two points

1. You can only have 1 PTR record per IP address

2. You probably have no control over your PTR, this is handled by your ISP.

```
$ host 200.206.190.252

252.190.206.200.in-addr.arpa domain name pointer 200-206-190-252.speedyterra.com.br.

```

Your PTR for the 192.168.0 zone suffers from point 1 above

Take a look at the caraguatatuba zone file, that is the correct way to write a zone file.

----------

