Domains with multiple hosts being improperly cached. [BIND 9.2.2]
Martin Glaude
martin at simaltech.com
Thu Aug 7 16:57:39 UTC 2003
I run a webserver hosting a few domains. Each domain has an entry for
"domain.com" and another for "www.domain.com". In most cases the
"www" domain is a CNAME, but I've also tried with A records. See
below for an example.
The problem is that I can query for the "domain.com" address and get a
proper response (after a brief delay). However, if I then query for
"www.domain.com", I get a SERVFAIL error immediately - as though the
local computer never queried the server. The reverse case
("www.domain.com" then "domain.com") still results in a success on the
first query, then failures. Queries to the second domain only seem to
work after the cache-time of the first one has expired and things
start from fresh once again.
-----------------------------------------------------
Example hosts file:
[root at www marty]# cat /var/named/simaltech.com.hosts
$ttl 38400
simaltech.com. IN SOA 66.206.231.25. martin.simaltech.com. (
1051192071
10800
3600
604800
38400 )
simaltech.com. IN NS 66.206.231.25.
simaltech.com. IN A 66.206.231.25
*.simaltech.com. IN MX 5 simaltech.com.
www.simaltech.com. IN CNAME simaltech.com.
mail.simaltech.com. IN CNAME simaltech.com.
tat.simaltech.com. IN CNAME simaltech.com.
------------------------------------------------------
Example queries:
[marty at other marty]$ dig simaltech.com
; <<>> DiG 9.2.1 <<>> simaltech.com
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 25885
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 0
;; QUESTION SECTION:
;simaltech.com. IN A
;; ANSWER SECTION:
simaltech.com. 36717 IN A 66.206.231.25
;; AUTHORITY SECTION:
simaltech.com. 36717 IN NS 66.206.231.25.
;; Query time: 1 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Thu Aug 7 12:56:21 2003
;; MSG SIZE rcvd: 74
[marty at other marty]$ dig www.simaltech.com
; <<>> DiG 9.2.1 <<>> www.simaltech.com
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 39416
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;www.simaltech.com. IN A
;; Query time: 1 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Thu Aug 7 12:56:38 2003
;; MSG SIZE rcvd: 35
------------------------------------------------------------------
The named.conf file:
[root at www marty]# cat /etc/named.conf
options {
directory "/var/named";
// query-source address * port 53;
};
zone "." IN {
type hint;
file "named.ca";
};
zone "localhost" IN {
type master;
file "localhost.zone";
allow-update { none; };
};
zone "0.0.127.in-addr.arpa" IN {
type master;
file "named.local";
allow-update { none; };
};
zone "simaltech.com" {
type master;
file "/var/named/simaltech.com.hosts";
};
// More domains continue below here...
More information about the bind-users
mailing list