Hi,
This has really got me stumped. I'm trying to setup a small (home) network
that connects to the internet via modem (ppp0). I would like for guests to
be able to access this network without any/much setup so I am running a
dhcp server that should also update the DNS so that others, and especially
the main server can access by name.
Seems pretty straight forward doesn't it? And it works except for one small
problem. DNS queries not using the FQDN fail while queries using the FQDN
succeed. IOW dig host.xxx.xxx is ok but dig host is not found. This causes
some big delays during various operations on the clients as their queries
always timeout first.
I'm hoping it's just one of those little details that I missed because of
the late hour.....
Here's the relevant files and info. I've changed lot's of stuff trying to
track this down so you may see some odd entries here and there that I
forgot to remove. Also, some names/addresses have been obviously disguised.
This is Fedora Core 3 (nash) on a Pentium4.
The dhcp and dns servers run on center.frank.home which is at 192.168.0.5.
There is a laptop (laptop-wlan) connected at 192.168.0.9.
From the laptop I get these responses (the log output follows). It's similar
when I use the laptop's hostname.
frank@laptop-wlan:~> dig center.frank.home
; <<>> DiG 9.2.3 <<>> center.frank.home
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 16573
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 0
;; QUESTION SECTION:
;center.frank.home. IN A
;; ANSWER SECTION:
center.frank.home. 259200 IN A 192.168.0.5
;; AUTHORITY SECTION:
frank.home. 259200 IN NS center.frank.home.
;; Query time: 3 msec
;; SERVER: 192.168.0.5#53(192.168.0.5)
;; WHEN: Tue Jan 18 01:19:25 2005
;; MSG SIZE rcvd: 66
frank@laptop-wlan:~> dig central
; <<>> DiG 9.2.3 <<>> central
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 33026
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0
;; QUESTION SECTION:
;central. IN A
;; AUTHORITY SECTION:
.. 408 IN SOA A.ROOT-SERVERS.NET.
NSTLD.VERISIGN-GRS.COM. 2005011701 1800 900 604800 86400
;; Query time: 3 msec
;; SERVER: 192.168.0.5#53(192.168.0.5)
;; WHEN: Tue Jan 18 01:19:27 2005
;; MSG SIZE rcvd: 99
----------------------------------------------------------------
from named.run during the preceding commands:
Jan 18 01:23:05.970 client 192.168.0.9#32768: UDP request
Jan 18 01:23:05.970 client 192.168.0.9#32768: request is not signed
Jan 18 01:23:05.970 client 192.168.0.9#32768: recursion available: approved
Jan 18 01:23:05.970 client 192.168.0.9#32768: query
Jan 18 01:23:05.970 client 192.168.0.9#32768: query 'center.frank.home/IN'
approved
Jan 18 01:23:05.970 client 192.168.0.9#32768: send
Jan 18 01:23:05.971 client 192.168.0.9#32768: sendto
Jan 18 01:23:05.971 client 192.168.0.9#32768: senddone
Jan 18 01:23:05.971 client 192.168.0.9#32768: next
Jan 18 01:23:05.971 client 192.168.0.9#32768: endrequest
Jan 18 01:23:05.971 client @0xf8fa84f8: udprecv
Jan 18 01:23:09.748 client 192.168.0.9#32768: UDP request
Jan 18 01:23:09.748 client 192.168.0.9#32768: request is not signed
Jan 18 01:23:09.748 client 192.168.0.9#32768: recursion available: approved
Jan 18 01:23:09.748 client 192.168.0.9#32768: query
Jan 18 01:23:09.749 client 192.168.0.9#32768: query (cache) approved
Jan 18 01:23:09.749 client 192.168.0.9#32768: send
Jan 18 01:23:09.749 client 192.168.0.9#32768: sendto
Jan 18 01:23:09.749 client 192.168.0.9#32768: senddone
Jan 18 01:23:09.749 client 192.168.0.9#32768: next
Jan 18 01:23:09.749 client 192.168.0.9#32768: endrequest
Jan 18 01:23:09.749 client @0xf8fa84f8: udprecv
/etc/hosts:
127.0.0.1 localhost.localdomain localhost
192.168.0.5 center.frank.home center
--------------------------------------
/etc/resolv.conf
search frank.home
nameserver 127.0.0.1
---------------------------------------
sysconfig/named:
# Currently, you can use the following options:
# ROOTDIR="/some/where" -- will run named in a chroot environment.
# you must set up the chroot environment before
# doing this.
# OPTIONS="whatever" -- These additional options will be passed to named
# at startup. Don't add -t here, use ROOTDIR instead.
ROOTDIR=/var/named/chroot
OPTIONS="-d 4"
-----------------------------------------
named.conf:
//
// named.conf for Red Hat caching-nameserver
//
# this has to be the same key as is used in dhcpd.conf
key mykey {
algorithm hmac-md5;
secret "vGfQnexyQt9f3ap4jOhpYQ==";
};
acl "home" {192.168.0.0/24; 127.0.0.1; };
options {
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
pid-file "/var/named/named.pid";
statistics-file "/var/named/data/named_stats.txt";
allow-query { "home"; };
forwarders { my.isp's.dns1; my.isp's.dns2 };
listen-on port 53 { 192.168.0.5; 127.0.0.1; };
auth-nxdomain yes;
/*
* If there is a firewall between you and nameservers you want
* to talk to, you might need to uncomment the query-source
* directive below. Previous versions of BIND always asked
* questions using port 53, but BIND 8.1 uses an unprivileged
* port by default.
*/
// query-source address * port 53;
};
//
// a caching only nameserver config
//
controls {
inet 127.0.0.1 port 953 allow { 127.0.0.1; 192.168.0.5; } keys
{ mykey; };
};
zone "." IN {
type hint;
file "named.ca";
};
zone "localdomain" IN {
type master;
file "localdomain.zone";
allow-update { none; };
};
zone "localhost" IN {
type master;
file "localhost.zone";
allow-update { none; };
};
zone "0.0.127.in-addr.arpa" IN {
type master;
file "named.local";
notify no;
};
zone
"0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0 .0.0.0.0.0.0.ip6.arpa" IN
{
type master;
file "named.ip6.local";
allow-update { none; };
};
zone "255.in-addr.arpa" IN {
type master;
file "named.broadcast";
allow-update { none; };
};
zone "0.in-addr.arpa" IN {
type master;
file "named.zero";
allow-update { none; };
};
zone "frank.home" IN {
type master;
notify no;
file "frank.home";
allow-update { key mykey; };
};
zone "0.168.192.in-addr.arpa" IN {
type master;
notify no;
file "192.168.0.rev";
allow-update { key mykey; };
};
--------------------------------
dhcpd.conf
option domain-name "frank.home";
option domain-name-servers 192.168.0.5;
option routers 192.168.0.5;
option lpr-servers 192.168.0.5;
default-lease-time 14400;
ddns-update-style interim;
# this has to be the same key as is used in named.conf
key mykey {
algorithm hmac-md5;
secret "vGfQnexyQt9f3ap4jOhpYQ==";
};
zone frank.home {
primary 192.168.0.5;
key mykey;
}
zone 0.168.192.in-addr.arpa. {
primary 192.168.0.5;
key mykey;
}
subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.6 192.168.0.20;
default-lease-time 14400;
max-lease-time 172800;
ddns-updates on;
option routers 192.168.0.5;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.0.255;
option domain-name "frank.home";
one-lease-per-client on;
option ip-forwarding off;
option domain-name-servers 192.168.0.5;
option smtp-server 192.168.0.5;
option netbios-name-servers 192.168.0.5;
# ignore client-updates;
authoritative;
}
--------------------------------
frank.home
$ORIGIN .
$TTL 259200 ; 1 hour
frank.home. IN SOA center.frank.home.
root.center.frank.home. (
17 ; serial
21600 ; refresh (6 hours)
1800 ; retry (30 minutes)
604800 ; expire (1 week)
3600 ; minimum (1 hour)
)
IN NS center.frank.home.
IN A 192.168.0.5
IN MX 10 center.frank.home.
TXT "frank Main Home"
$ORIGIN frank.home.
$TTL 259200 ; 3 days
dhcp IN A 192.168.0.5
center IN A 192.168.0.5
ns1 IN A 192.168.0.5
fw IN A 192.168.0.5
gateway IN A 192.168.0.5
mail IN A 192.168.0.5
ns1 IN A 192.168.0.5
pdc IN A 192.168.0.5
proxy IN A 192.168.0.5
www IN A 192.168.0.5
$TTL 86400 ; 1 day
laptop-wlan A 192.168.0.9
TXT "31b930ecfbbc8a01fbf8c6fc0a3a4ea3f5"
--------------------------------
192.168.0.rev
$ORIGIN .
$TTL 259200 ; 3 days
0.168.192.in-addr.arpa IN SOA center.frank.home. root.center.frank.home.
(
13 ; serial
28800 ; refresh (8 hours)
7200 ; retry (2 hours)
604800 ; expire (1 week)
86400 ; minimum (1 day)
)
NS center.frank.home.
$ORIGIN 0.168.192.in-addr.arpa.
5 PTR fw.frank.home.
PTR ns1.frank.home.
PTR pdc.frank.home.
PTR
www.frank.home.
PTR dhcp.frank.home.
PTR mail.frank.home.
PTR proxy.frank.home.
PTR center.frank.home.
PTR gateway.frank.home.
$TTL 86400 ; 1 day
9 PTR laptop-wlan.frank.home