Dnsmasq is a lightweight, easy to configure DNS forwarder, designed to provide DNS (and optionally DHCP and TFTP) services to a small-scale network. It can serve the names of local machines which are not in the global DNS.
Step 1 : Installing Dnsmasq
yum install dnsmasq
Step 2 : Configure Dnsmasq
#delete all & insert
server=18.104.22.168 (we are using Opendns as a dns resolver)
server=22.214.171.124 (dnsmasq can set multiple dns resolver,if other resolver fails,it will ask for others resolver.)
no-dhcp-interface=eth0 (your network interface)
Cd to dnsmasq.d and create a config file, we will create a redirect.conf here.
To specify a domain, we need a server ip and your domain.
save & quit
service dnsmasq start
Change your pc’s dns to your dns server ip address, nslookup your domain set just now.