After much more googling and debugging and experimenting, I got a little further, and it looks like it's almost perfectly working. A few little questions remain though. But first things first.
The server is running DHCP and DNS, so here's what /etc/dhcpd.conf looks like (I shortened the listings down to one server and three clients:
Code:
# /etc/dhcpd.conf
authoritative;
default-lease-time 86400;
max-lease-time 86400;
option broadcast-address 192.168.2.255;
option subnet-mask 255.255.255.0;
option routers 192.168.2.254;
option domain-name-servers 192.168.2.1;
option domain-name "microlinux.montpezat";
option domain-search "microlinux.montpezat";
subnet 192.168.2.0 netmask 255.255.255.0 {
range 192.168.2.100 192.168.2.200;
}
host alphamule {
hardware ethernet 00:1D:92:B2:F3:9E;
fixed-address 192.168.2.2;
option host-name "alphamule";
}
host bernadette {
hardware ethernet 00:1D:09:15:4A:D8;
fixed-address 192.168.2.3;
option host-name "bernadette";
}
host raymonde {
hardware ethernet 00:1E:C9:43:A7:BF;
fixed-address 192.168.2.4;
option host-name "raymonde";
}
I added the domain-search option, so now a client's /etc/resolv.conf looks like this:
Code:
# Generated by dhcpcd from eth0
# /etc/resolv.conf.head can replace this line
domain microlinux.montpezat
search microlinux.montpezat
nameserver 192.168.2.1
# /etc/resolv.conf.tail can replace this line
No changes were made to /etc/named.conf.
The zone file for the "microlinux.montpezat" zone looks like this:
Code:
; zone.microlinux.montpezat
$TTL 86400
$ORIGIN microlinux.montpezat.
@ IN SOA nestor.microlinux.montpezat. hostmaster.microlinux.montpezat. (
2012120805 ; serial
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
IN NS nestor.microlinux.montpezat.
nestor IN A 192.168.2.1
alphamule IN A 192.168.2.2
bernadette IN A 192.168.2.3
raymonde IN A 192.168.2.4
And here's the reverse zone file:
Code:
; revp.192.168.2
$ORIGIN 2.168.192.in-addr.arpa.
$TTL 86400
@ IN SOA nestor.microlinux.montpezat. hostmaster.microlinux.montpezat. (
2012120805 ; serial
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
IN NS nestor.microlinux.montpezat.
1 IN PTR nestor.microlinux.montpezat.
2 IN PTR alphamule.microlinux.montpezat.
3 IN PTR bernadette.microlinux.montpezat.
4 IN PTR raymonde.microlinux.montpezat.
Now I can do the following from any machine on the network.
Query a hosts' IP address using nslookup:
Code:
[kikinovak@alphamule:~] $ nslookup raymonde
Server: 192.168.2.1
Address: 192.168.2.1#53
Name: raymonde.microlinux.montpezat
Address: 192.168.2.4
Query an IP address to know the hostname using nslookup:
Code:
[kikinovak@alphamule:~] $ nslookup 192.168.2.4
Server: 192.168.2.1
Address: 192.168.2.1#53
4.2.168.192.in-addr.arpa name = raymonde.microlinux.montpezat.
Query an IP address using dig, but only with the FQDN:
Code:
[kikinovak@alphamule:~] $ dig raymonde.microlinux.montpezat +short
192.168.2.4
Here's what still doesn't work, and I don't know why:
Code:
[kikinovak@alphamule:~] $ dig raymonde
; <<>> DiG 9.9.1-P4 <<>> raymonde
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 27327
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;raymonde. IN A
;; AUTHORITY SECTION:
. 3143 IN SOA a.root-servers.net. nstld.verisign-grs.com. 2012120800 1800 900 604800 86400
;; Query time: 3 msec
;; SERVER: 192.168.2.1#53(192.168.2.1)
;; WHEN: Sat Dec 8 13:19:06 2012
;; MSG SIZE rcvd: 112
Maybe this behavior is normal, after all.
Any suggestions? Anyone spotted some misconfiguration somewhere?