I have a FC6 box that is my dhcpd and named server. It has one nic connected to the cable modem and the other nic is connected to the local network switch or crossover cable ( depending on what I'm doing ).
The Internet side is firewalled but the local net has free access to each other and I can ping them by name because the dhcp server updates my dns zones.
You may be interested in these articles but, the second one is for setup to ping within the lan by computer name. In fact, I removed the package called caching-nameserver and it still works fine for Linux and Windows clients.
http://www.redhat.com/magazine/025nov06/features/dns/
http://www.redhat.com/magazine/026dec06/features/dns/
From my notes:
At the fedora client machines /etc/sysconfig/network-scripts/ifcfg-eth0
DHCP_HOSTNAME=mudd.mydomain.com
causes the dns reverse zone entry to look like this...
set ddns-fwd-name = "mudd.mydomain.com.mydomain.com";
That also causes ping to fail when using just the host name: ping mudd
To correct this, use just the host name
DHCP_HOSTNAME=mudd
The file /etc/sysconfig/network can use the full name without problems.
HOSTNAME=mudd.mydomain.com
Make sure the /etc/resolv.conf is using your server address at the server and linux clients.
Code:
search mydomain.com
nameserver 192.168.0.1
Save the named.conf file and then assign 644 permissions:
chmod 644 /var/named/chroot/etc/named.conf
Check the syntax using the named-checkconf utility provided by the bind RPM:
named-checkconf named.conf
/var/named/chroot/etc/named.conf
Code:
//
// named.conf for Red Hat caching-nameserver
//
acl internal_net { 192.168.0.0/24; 127.0/8; };
options {
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
listen-on { 127.0.0.1; 192.168.0.1; };
allow-query { 127.0.0.1; 192.168.0.0/24; };
query-source address * port 53;
# Use Your Own ISP Servers Here
forwarders {
123.123.123.100;
123.123.123.200;
123.123.123.300;
};
};
zone "0.168.192.in-addr.arpa" IN {
type master;
file "192.168.0.zone";
allow-update { internal_net; };
};
zone "mydomain.com." IN {
type master;
file "mydomain.com.zone";
allow-update { internal_net; };
};
/var/named/chroot/var/named/192.168.0.zone
Code:
$TTL 1D
@ IN SOA server.mydomain.com. root.localhost (
200612060 ; serial
2H ; refresh slaves
5M ; retry
1W ; expire
1M ; Negative TTL
)
IN NS server.mydomain.com.
1 IN PTR server.mydomain.com.
/var/named/chroot/var/named/mydomain.com.zone
Code:
$TTL 1D
@ IN SOA server.mydomain.com. root.localhost (
200612060 ; serial
2H ; refresh slaves
5M ; retry
1W ; expire
1M ; Negative TTL
)
IN NS server.mydomain.com.
server.mydomain.com. IN A 192.168.0.1 ; server
Note: it is important to set chown and chmod for these files.
Code:
chown named:named /var/named/chroot/var/named/mydomain.com.zone
chown named:named /var/named/chroot/var/named/192.168.0.zone
chmod 644 /var/named/chroot/var/named/mydomain.com.zone
chmod 644 /var/named/chroot/var/named/192.168.0.zone
/etc/dhcpd.conf
Code:
#
# DHCP Server Configuration file.
# see /usr/share/doc/dhcp*/dhcpd.conf.sample
ddns-update-style interim;
ddns-updates on;
allow client-updates;
ddns-domainname "mydomain.com";
server-name "192.168.0.1";
max-lease-time 86400;
default-lease-time 86400;
subnet 192.168.0.0 netmask 255.255.255.0 {
option domain-name-servers 192.168.0.1;
option domain-name "mydomain.com";
option broadcast-address 192.168.0.255;
option subnet-mask 255.255.255.0;
option routers 192.168.0.1;
range 192.168.0.2 192.168.0.50;
}
Restart dhcpd and named.
When a client gets an address, you may not notice changes in the zones right away but that's ok if you can ping by name.
The /var/lib/dhcpd/dhcpd.leases file does show changes right away and should have the correct info.
For example:
Code:
lease 192.168.0.49 {
starts 3 2006/12/27 03:15:15;
ends 4 2006/12/28 03:15:15;
binding state active;
next binding state free;
hardware ethernet 00:40:f4:6f:d5:fc;
uid "\001\000@\364o\325\374";
set ddns-rev-name = "49.0.168.192.in-addr.arpa.";
set ddns-txt = "319e51316b19d15e4208cbaec7b83ae39e";
set ddns-fwd-name = "e050.mydomain.com";
client-hostname "e050";
}