Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm working on Diskless Linux Clusters. I'm using Ubuntu Server 12.04( DHCP, TFTP and NFS servers installed and configured). When I boot slave machines via Live CD, all of them have same hostname but different IP addresses. I want to set hostname/ip address pair to slave machines via DHCP server without knowing slaves MAC addresses. For example:

      IP       Hostname 
192.168.1.200   slave1
192.168.1.201   slave2
...
192.168.1.253   slave54

When a slave machine dynamically get 192.168.1.201 IP address from DHCP server, its hostname must be slave2. I used this solution on client side to get hostname from DHCP Server. But I don't know how to do this matching "192.168.1.201 slave2" on server side. My DHCP config file:

...

subnet 192.168.1.0 netmask 255.255.255.0  {
    range dynamic-bootp 192.168.1.200 192.168.1.253; # Range of lease IP  address
    option broadcast-address 192.168.1.255;
    option routers 192.168.1.1;
}

next-server 192.168.1.10; # PXE server address
filename “pxelinux.0”;

DHCP server dynamically assigns IP addresses to clients without knowing clients MAC address. I think that it can assign hostnames too. Is there a way to do that? Please give me any advice.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

My professor answered my question. There is no specific tool or method to assign hostname and ip address pair without knowing MAC address in Linux Server. Because Linux server uses pure DHCP standards. So I have to assign a hostname/fixed ip address with MAC address for each slave in /etc/dhcp/dhcpd.conf file. For example:

host slave1 {
  hardware ethernet 00:00:00:00:00:01;
  fixed-address 192.168.1.200;
  option host-name "slave1";
}

host slave2 {
   hardware ethernet 00:00:00:00:00:02;
   fixed-address 192.168.1.201;
   option host-name "slave2";
}
...

He said: "you can do that with using hostname table in Windows NT Server". But i'm not sure how to do that.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.