How to manage hostnames via DHCP?

Niki Kovacs contact at kikinovak.net
Fri Mar 11 16:14:36 UTC 2011


Le 10/03/2011 09:30, Tom H a écrit :

>> Le 09/03/2011 13:34, Tom H a écrit :
>>>
>>> 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")
>>

I tried what you suggested. Works like a charm.

$ ls /etc/hostname
ls: cannot access /etc/hostname: No such file or directory
$ cat /etc/hosts
127.0.0.1	localhost.localdomain localhost
$ hostname --fqdn
raymonde.presbytere.montpezat

Thanks again.

Niki




More information about the ubuntu-users mailing list