Score:0

Problem enabling dnsmasq

za flag

I work on Ruby on Rails project which uses some subdomains and custom domains. I have installed dnsmasq server and added this to the starting of the file:

address=/xyz.test/127.0.0.1
address=/xyzsites.test/127.0.0.1
address=/abc.test/127.0.0.1
address=/ab.test/127.0.0.1

But that doesn't work automatically. Each time my laptop boots I have to set IP address in resolv.conf file like this:

nameserver 192.168.xx.x
nameserver 8.8.8.8

And it starts working. I know the file gets reset on each reboot or NetworkManager restart but I am using a desktop PC too which has a similar configuration I have never faced issues on that. The default configuration of this file is on both the PC and laptop is:

search dlink.router
# this is set to the router's IP address and not the system's IP address 
nameserver 192.168.xx.x

With the same file, it works on my PC but not the laptop. I have tried installing resolvconf but that didn't work instead my internet stopped working and I had to remove it.

I also tried setting this in /etc/NetworkManager/NetworkManager.conf:

[main]
dns=dnsmasq

but then my internet stopped working again and I had to set it to default.

What could I do to make it work automatically or what could I check to match it to my other PC's configuration or if anyone has any other suggestions?

Note: My /etc/hosts file has some entries like this:

127.0.0.1   xyz.test
127.0.0.1   *.xyz.test
127.0.0.1   us.xyz.test
127.0.0.1   secure.xyz.test
127.0.0.1   123.xyz.test
127.0.0.1   xyzsites.test

I am not sure if this would matter.

in flag
What distro/version are you using (see `lsb_release -a`). I suspect your problem is that youve got two resolvers working, have a look at systemd-resolved.
Deepesh avatar
za flag
@pbhj Ubuntu 20.04.3 LTS and the `systemd-resolved.service` is dead
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.