I've configured a host-only (aka private) network for a group of VMs on a CentOS 7 host. I've created static leases in the DHCP section for the virtual network.
The IP address is getting set correctly, but the hostname is ignored. Instead, it's falling back to the transient hostname. Here's the output of hostnamectl
:
Static hostname: n/a
Transient hostname: vmname
Icon name: computer-vm
Chassis: vm
Machine ID: 7944dc3acb404c81b272fb8ac4b047fd
Boot ID: ac7efda81d644700a9a51a9cff9c12cb
Virtualization: kvm
Operating System: CentOS Linux 7 (Core)
CPE OS Name: cpe:/o:centos:centos:7
Kernel: Linux 3.10.0-327.13.1.el7.x86_64
Architecture: x86-64
This is my network configuration:
<network>
<name>virtnet1</name>
<bridge name="virbr1" />
<ip address="10.2.2.101" netmask="255.255.255.0">
<dhcp>
<range start='10.2.2.30' end='10.2.2.99'/>
<host mac='52:54:00:a3:5d:44' name='myhost' ip='10.2.2.9'/>
</dhcp>
</ip>
</network>