I want to get fast dns resolution with dnsmasq and keep the default systemd-resolved.
Looking for an elegant way to do this
I want to get fast dns resolution with dnsmasq and keep the default systemd-resolved.
Looking for an elegant way to do this
Previously, on Ubuntu 16.04, I felt betrayed when an Ubuntu update installed dnsmasq
package, configured it, and gave it precedence over my own super-stable, ultra-fast, and own-configured BIND DNS server. It exactly felt as if Ubuntu hacked my workstation.
Since I happened to be working as a system admin, this was extremely unacceptable. This was a freak-out call. This is when you go to troubleshoot a problem and in one of your steps you use dig
or nslookup
and you get stunned to see the lo
interface replying to you. PANIC
Is there a way to not only fix this issue, but also guarantee that /etc/resolv.conf
will be tamper proof?
On Ubuntu 14.04 I'm using dnsmasq to resolve wildcard example.com domains to the local machine (desktop computer at home).
After much reading around I cannot for the life of me sort out the same on a clean install of 18.04.
All I want to achieve at the moment is:
ping example.com
to ping 127.0.0.1 and not 93.184.216.34;ping anysubdomain.example.com
to also ping 127.0.0.1;ping google.com
to ping the real google.com via the router/IP DNS.Surely this must be simple, even trivial?
But I'm stumped. I can get the example.com's resolving but only at the expense of breaking everything else.
How can I do this?
I was setting up a server as in the below link https://help.ubuntu.com/community/Dnsmasq
root@user-desktop:/etc/init.d# sudo apt-get install dnsmasq
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
dnsmasq
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/15.4 kB of archives.
After this operation, 120 kB of additional disk space will be used.
Selecting previously unselected package dnsmasq.
(Reading database ... 146283 files and directories currently installed.)
Unpacking dnsmasq (from .../dnsmasq_2.59-4_all.deb) ...
Processing triggers for ureadahead ...
Setting up dnsmasq (2.59-4) ...
* Starting DNS forwarder and DHCP server dnsmasq
dnsmasq: failed to create listening socket for port 53: Address already in use [fail]
invoke-rc.d: initscript dnsmasq, action "start" failed.
I have installed DNSMASQ but it was not starting as 53 port was busy.
I found out that ubuntu already had dnsmasq package and it's working.
Now the problem is...I just want to be able to resolve my hosts in /etc/hosts through it
i.e: nslookup somehostonlan localhost
to be resolved to certain IP taken from /etc/hosts file.
but this is not happening.
Why? BTW, as the caching DNS server it's working fine. I just want it to resolve hosts from /etc/hosts file that's all