Dnsmasq is a great lightweight server that can provide DHCP, DNS, and TFTP services for a small network.
I didn’t see any Centos 7 specific guides on the internet when I made this, so here is mine.
Dnsmasq will query the file you specify at the end of the config before looking at upstream resolvers (/etc/resolv.conf). Use the same syntax as you would in the host file.
DNSMASQ setup for CENTOS 7
#yum install dnsmasq
//turn on the server and make sure it starts on boot
#systemctl start dnsmasq
#systemctl enable dnsmasq
# firewall-cmd –zone=public –add-port=53/tcp
# firewall-cmd –zone=public –add-port=53/udp
# firewall-cmd –permanent –zone=public –add-port=53/tcp
# firewall-cmd –permanent –zone=public –add-port=53/udp
//the config file is located at /etc/dnsmasq.conf
//uncomment this line to turn off lookups from the host file
//uncomment and modify this line to add a new file for lookups