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.