Providing host names via private IP addresses / DHCP

Paul Howarth paul at city-fan.org
Thu Dec 16 14:59:39 UTC 2004


Michael D. Setzer II wrote:
> I've got a machine currently running Fedora Core 1, and over the 
> semester break I want upgrade it to FC3, and also get the machine 
> to provide hostnames. Currenlty the machine has 9 ethernet ports, 
> one connected to the college backbone, and the other 8 planned to 
> go to 8 computer labs of 20 computer each. I have the DHCP setup 
> to provide different blocks of IPs to each room off each port, 
> 192.168.1.x thru 192.168.8.x, but the systems don't get host names. 
> The IPtables configuration provides web access, and even the FTP 
> with the ip_tables entries, but not the host name. I am just looking to 
> get the machines to have names like host1-100 or similar. Right 
> now, the labs connect directly to the backbone with no firewall, and 
> get names like host73-196.guamcc.net. 
> 
> My primary lab currently has multi-boot machines with 98/XP/FC2 or 
> FC3, currently 12 with FC3 and 8 with FC2. 

Set up your nameserver to handle reverse DNS for the IP addresses in your DCHP 
pool.

e.g.:

named.conf snippet for rDNS for 10.1.2.*:

zone "2.1.10.in-addr.arpa" IN {
         type master;
         file "master/2.1.10.in-addr.arpa";
         allow-update { none; };
};

File master/2.1.10.in-addr.arpa:

$ORIGIN 2.1.10.in-addr.arpa.
$TTL 86400 ; Default TTL for this zone (1 day)
@               IN      SOA     ns1.internal.example.com. you.example.com. (
                                 2004121601      ; serial
                                 1H              ; refresh
                                 5M              ; retry
                                 2W              ; expiry
                                 4H )            ; minimum TTL

                         NS      ns1.internal.example.com.
                         NS      ns2.internal.example.com.

$GENERATE 0-255	$	PTR	10-1-2-$.dhcp.example.com.


You probably want a forward zone to go with these entries:

zone "dhcp.example.com" IN {
	type master;
	file "master/dhcp.example.com";
	allow-update { none; };
};

File master/dhcp.example.com:

$ORIGIN dhcp.example.com.
$TTL 86400 ; Default TTL for this zone (1 day)

@               IN      SOA     ns1.internal.example.com. you.example.com. (
                                 2004121601      ; serial
                                 1H              ; refresh
                                 5M              ; retry
                                 2W              ; expiry
                                 4H )            ; minimum TTL

                         NS      ns1.internal.example.com.
                         NS      ns2.internal.example.com.

$GENERATE 0-255 10-1-2-$ A	10.1.2.$

Paul.




More information about the fedora-list mailing list