I have a server which currently staticly addressed with an entry in its /etc/hosts
file, e.g.:
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.1.91 docker docker.local
I'd like to introduce this server to DHCP so I can let it have its static IP from the DHCP server.
For that, I plan to change the server's /etc/hosts
to:
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 docker docker.local
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
#192.168.1.91 docker docker.local
However, once I did that, what do I have to do to ask the DHCP server to allocate an address to docker.local - without rebooting docker.local (it's on CentOS 7)?
I suspect I'd have to do sudo ifdown enp132s0 && sudo ifup eth0
, but am not sure if that'd be all.
Note that /etc/sysconfig/network-scripts/ifcfg-enp132s0
also hardcodes the IP:
TYPE="Ethernet"
BOOTPROTO=none
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_FAILURE_FATAL="no"
IPV6_ADDR_GEN_MODE="stable-privacy"
NAME="enp132s0"
UUID="4ccacac5-fd8a-46a7-9279-6f9fea7d066e"
DEVICE="enp132s0"
ONBOOT="yes"
DNS1=8.8.8.8
IPADDR=192.168.1.91
PREFIX=24
GATEWAY=192.168.1.99
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes