How to manage hostnames via DHCP?
Tom H
tomh0665 at gmail.com
Wed Mar 9 12:34:54 UTC 2011
On Wed, Mar 9, 2011 at 2:43 AM, Niki Kovacs <contact at kikinovak.net> wrote:
>
> I'm just trying to figure out how to handle hostnames via DHCP on a small
> LAN. I know how to do it with CentOS, so I'll describe the process on my
> CentOS machines.
>
> On the server side, I have a dhcpd.conf that looks like this:
>
>...
>
> Then on the client side, every machine that gets its network configuration
> via DHCP is configured like this:
>
> --8<---------- /etc/sysconfig/network --------------
> NETWORKING=yes
> NETWORKING_IPV6=no
> HOSTNAME=localhost.localdomain
> --8<------------------------------------------------
>
> --8<---------- /etc/sysconfig/network-scripts/ifcfg-eth0 -
> DEVICE=eth0
> BOOTPROTO=dhcp
> ONBOOT=yes
> --8<------------------------------------------------
>
> --8<---------- /etc/hosts --------------------------
> 127.0.0.1 localhost.localdomain localhost
> --8<------------------------------------------------
>
> In this example, no machine has a "static" hostname configuration.
> Everything is managed centrally on the server. The 'hostname' and 'hostname
> --fqdn' commands work correctly, in that they return something like
> 'raymonde' or 'raymonde.presbytere.montpezat'.
>
> Now, how can I do the same thing on a 100 % Ubuntu network, version 10.04 on
> server and desktops?
On the clients, if not using NM:
# cat /etc/network/interfaces
auto lo
iface lo inet loop
auto eth0
iface eth0 inet dhcp
# rm /etc/hostname
# cat /etc/hosts
127.0.0.1 localhost.localdomain localhost
# vi /etc/default/grub
(edit the following line)
GRUB_CMDLINE_LINUX="ipv6.disable=1"
(run update-grub to update the grub configuration)
(if you prefer, you can use "/etc/modprobe.d/" files)
(If using NM, you probably only have to "rm /etc/hostname")
More information about the ubuntu-users
mailing list