# DNS giving me " reply from unexpected source: 192.168.1.100#53, expected 127.0.0.1#53



## cucu007 (Feb 9, 2011)

I think I got DNS working properly, yet when I try dig http://www.yahoo.com I am getting a weird unexpected result with the correct answer. Any ideas what this is about? I am running this in a jail.


```
[root@cesrv01 /]# dig [url]www.yahoo.com[/url]
;; reply from unexpected source: 192.168.1.100#53, expected 127.0.0.1#53

; <<>> DiG 9.7.2-P3 <<>> [url]www.yahoo.com[/url]
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 43979
;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 13, ADDITIONAL: 11

;; QUESTION SECTION:
;[url]www.yahoo.com[/url].                 IN      A

;; ANSWER SECTION:
[url]www.yahoo.com[/url].          188     IN      CNAME   fp.wg1.b.yahoo.com.
fp.wg1.b.yahoo.com.     3086    IN      CNAME   any-fp.wa1.b.yahoo.com.
any-fp.wa1.b.yahoo.com. 41      IN      A       69.147.125.65
any-fp.wa1.b.yahoo.com. 41      IN      A       67.195.160.76

;; AUTHORITY SECTION:
.                       77963   IN      NS      d.root-servers.net.
.                       77963   IN      NS      i.root-servers.net.
.                       77963   IN      NS      k.root-servers.net.
.                       77963   IN      NS      c.root-servers.net.
.                       77963   IN      NS      g.root-servers.net.
.                       77963   IN      NS      h.root-servers.net.
.                       77963   IN      NS      f.root-servers.net.
.                       77963   IN      NS      j.root-servers.net.
.                       77963   IN      NS      a.root-servers.net.
.                       77963   IN      NS      m.root-servers.net.
.                       77963   IN      NS      e.root-servers.net.
.                       77963   IN      NS      l.root-servers.net.
.                       77963   IN      NS      b.root-servers.net.

;; ADDITIONAL SECTION:
a.root-servers.net.     77963   IN      A       198.41.0.4
b.root-servers.net.     77963   IN      A       192.228.79.201
c.root-servers.net.     77963   IN      A       192.33.4.12
d.root-servers.net.     77963   IN      A       128.8.10.90
e.root-servers.net.     77963   IN      A       192.203.230.10
f.root-servers.net.     77963   IN      A       192.5.5.241
g.root-servers.net.     77963   IN      A       192.112.36.4
h.root-servers.net.     77963   IN      A       128.63.2.53
i.root-servers.net.     77963   IN      A       192.36.148.17
j.root-servers.net.     77963   IN      A       192.58.128.30
k.root-servers.net.     77963   IN      A       193.0.14.129

;; Query time: 0 msec
;; SERVER: 192.168.1.100#53(192.168.1.100)
;; WHEN: Wed Feb  9 10:37:45 2011
;; MSG SIZE  rcvd: 498
```


----------



## SirDice (Feb 9, 2011)

What's in /etc/resolv.conf? And what does your named.conf look like?


----------



## cucu007 (Feb 9, 2011)

SirDice said:
			
		

> What's in /etc/resolv.conf? And what does your named.conf look like?



/etc/resolv.conf

```
domain domain.local
nameserver 127.0.0.1
nameserver 192.168.1.100
nameserver 192.168.1.200
```

/var/named/etc/namedb/named.conf

```
// named.conf configuration files for CENET
// If you are going to set up an authoritative server, make sure you
// understand the hairy details of how DNS works.  Even with
// simple mistakes, you can break connectivity for affected parties,
// or cause huge amounts of useless Internet traffic.

options {
    // Relative to the chroot directory, if any
    directory   "/etc/namedb";
    pid-file    "/var/run/named/pid";
    dump-file   "/var/dump/named_dump.db";
    statistics-file "/var/stats/named.stats";
    listen-on   { 192.168.1.100; };
    forwarders { 10.10.20.10; 10.10.20.11; };
     query-source address 192.168.1.100 port 65530;
};

// If you enable a local name server, don't forget to enter 127.0.0.1
// first in your /etc/resolv.conf so this server will be queried.
// Also, make sure to enable it in /etc/rc.conf.

// The traditional root hints mechanism. Use this, OR the slave zones below.
zone "." { 
        type hint; file "named.root"; 
};

zone "." {
        type slave;
        file "slave/root.slave";
        masters {
        192.5.5.241;    // F.ROOT-SERVERS.NET.
        };
        notify no;
};

zone "arpa" {
        type slave;
        file "slave/arpa.slave";
        masters {
        192.5.5.241;    // F.ROOT-SERVERS.NET.
        };
        notify no;
};
zone "in-addr.arpa" {
        type slave;
        file "slave/in-addr.arpa.slave";
        masters {
        192.5.5.241;    // F.ROOT-SERVERS.NET.
        };
        notify no;
};

/*  Serving the following zones locally will prevent any queries
    for these zones leaving your network and going to the root
    name servers.  This has two significant advantages:
    1. Faster local resolution for your users
    2. No spurious traffic will be sent from your network to the roots
*/
// RFC 1912
zone "localhost"    { type master; file "master/domain.local.fw.db"; };
zone "127.in-addr.arpa" { type master; file "master/domain.local.rv.db"; };
zone "255.in-addr.arpa" { type master; file "master/empty.db"; };

zone "cenet.citytech.cuny.edu" in {
        type master;
        file "etc/namedb/master/domain.local.fw.db";
        allow-update {none;};
};

// reverse map for local addresses at domain.local
zone "6.14.10.IN-ADDR.ARPA" in{
        type master;
        file "etc/namedb/master/domain.local.rv.db";
        allow-update {none;};
};

// localhost reverse map
zone "0.0.127.IN-ADDR.ARPA" in{
        type master;
        file "etc/namedb/master/localhost.rev";
        allow-update {none;};
};

// Configuration key for RNDC functionality
key "rndc-key" {
        algorithm hmac-md5;
        secret "top-secret";
};
```


----------



## wblock@ (Feb 9, 2011)

The machine running BIND is 192.168.1.100, right?  Take that out of /etc/resolv.conf on that machine.


----------



## SirDice (Feb 9, 2011)

Nope, that's not it. The named is actually listening on 192.168.1.100 and not on 127.0.0.1. So either add 127.0.0.1 to the listen-on directive in named.conf or remove 127.0.0.1 from /etc/resolv.conf.


----------



## DutchDaemon (Feb 9, 2011)

cucu007, *format your posts*, I'm not going to do all the work for you forever..


----------

