dnsmasq sometimes resolves things, sometimes it doesn't

I have this inside my internal network, and I solved it by disabling the local forwarding nameserver controlled by NetworkManager (dnsmasq).

To do that, you need to edit /etc/NetworkManager/NetworkManager.conf and comment out the “dns=dnsmasq” line in the "[main]" section.

Open a terminal, and run

sudo nano /etc/NetworkManager/NetworkManager.conf

Then make sure that the line

dns=dnsmasq

is commented out like this:

#dns=dnsmasq

Now, restart network-manager with the following command, and everything should work properly.

sudo restart network-manager