DHCP1234567891011121314151617181920212223242526272829303132333435yum install dhcpvi /etc/dhcp/dhcpd.confddns-update-style interim;(定义dns服务动态更新的类型,类型包括none interim ad-hoc)ignore client-updates;(allow允许/ignore忽略客户端更新DNS记录)subnet 192.168.1.0 netmask 255.255.255.0 { range 192.168.1.2 192.168.1.254; 设置地址范围 option routers 192.168.1.1; #设置网关 option subnet-mask 255.255.255.0; #设置掩码 option domain-name-servers 192.168.1.1; #设置DNS服务器地址 default-lease-time 21600; 设置默认租期21600秒 max-lease-time 43200; 设置最大租期43200秒}host 主机名 { hardware ethernet MAC地址 fixed-address 将某个固定ip地址分配给指定主机}option domain-name "xx.com" 定义域名systemctl start dhcpd