Run your own local lightweight DNS server like MaraDNS or Dnsmasq.
Whenever any software on your computer tries to reach out to internet with DNS name, it resolves to a corresponding IP addresses by querying a DNS server. This setup is usually done via
/etc/resolv.conf. But Unix systems before querying on network try to look it up locally on
/etc/hosts. If your destination IP address doesn't change, it is best you just put an entry in
If you don't want to do that, other way is to run a DNS server yourself. When you run a DNS server locally, you have to mention an upstream server. An upstream DNS server is basically a go-to DNS server (typically your ISP's or Google DNS or OpenDNS) which your local DNS can query.
If you are running Ubuntu/Debian follow this:
Once you have your Dnsmasq up and running, you should configure your dnsmasq to query your choice of NS for specific domain/s with
server=/example.com/126.96.36.199. example.com is the domain and the IP address is the Nameserver you want Dnsmasq to query.
Don't forget to update the
resolv.conf or other tools which controls
resolv.conf so that your computer queries locally.
That way for all requests, your computer queries your ISP provided DNS server and for a specific domain it queries IP address of your choice. HTH.
Ref: Dnsmasq Man page