FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu User

 
 
LinkBack Thread Tools
 
Old 03-09-2011, 06:43 AM
Niki Kovacs
 
Default How to manage hostnames via DHCP?

Hi,

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:

--8<---------- /etc/dhcpd.conf ---------------------------------
# Options globales
ddns-update-style interim;
authoritative;
default-lease-time 86400; # un jour
max-lease-time 86400; # un jour

# Données du réseau local
option broadcast-address 192.168.1.255;
option subnet-mask 255.255.255.0;
option routers 192.168.1.254;
option domain-name-servers 192.168.1.252;
option domain-name "presbytere.montpezat";

# Plage d'adresses dynamiques
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.10 192.168.1.250;
}

host babasse {
hardware ethernet 00:0d:61:ae:6b:8f;
fixed-address 192.168.1.1;
option host-name "babasse";
}

host bernadette {
hardware ethernet 00:0d:61:a6:e7:1e;
fixed-address 192.168.1.2;
option host-name "bernadette";
}

host raymonde {
hardware ethernet 00:20:ed:b8:e8:ec;
fixed-address 192.168.1.3;
option host-name "raymonde";
}

...
--8<------------------------------------------------

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?


Cheers from the sunny South of France,

Niki

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 03-09-2011, 11:34 AM
Tom H
 
Default How to manage hostnames via DHCP?

On Wed, Mar 9, 2011 at 2:43 AM, Niki Kovacs <contact@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")

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 03-10-2011, 05:35 AM
Niki Kovacs
 
Default How to manage hostnames via DHCP?

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")


Thanks for your detailed answer! I'll give that a shot.

Cheers,

Niki

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 03-10-2011, 07:30 AM
Tom H
 
Default How to manage hostnames via DHCP?

On Thu, Mar 10, 2011 at 1:35 AM, Niki Kovacs <contact@kikinovak.net> wrote:
> 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")
>
> Thanks for your detailed answer! I'll give that a shot.

You're welcome. Good luck.

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 03-11-2011, 03:14 PM
Niki Kovacs
 
Default How to manage hostnames via DHCP?

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

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 03-12-2011, 09:58 AM
Tom H
 
Default How to manage hostnames via DHCP?

On Fri, Mar 11, 2011 at 11:14 AM, Niki Kovacs <contact@kikinovak.net> wrote:
>
> 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.

You're welcome.

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 

Thread Tools




All times are GMT. The time now is 07:53 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org