You are not logged in.

#1 2021-09-29 10:01:40

Commander
Member
Registered: 2011-02-12
Posts: 43

[Solved] dnsmasq & systemd-resolved for development domains

Hi,

What I want
I want to have wildcard support for my local domains for development.
I have dev1.localtest.me and dev2.localtest.me

So i want *.localtest.me should resolve to a local ip i have that hosts these.

What I did
I have installed dnsmasq to add wildcard support.
I followed: https://wiki.archlinux.org/title/dnsmasq and https://sixfeetup.com/blog/local-develo … s-on-linux

dnsmasq.conf

/etc/dnsmasq.conf

+ address=/localtest.me/ip
+ listen-address=127.0.0.2
+ bind-interfaces

resolved.conf

/etc/systemd/resolved.conf

+ DNS=127.0.0.2
+ Domains=~/localtest.me

resolv.conf // seems to be generated by NetworkManager (no changes made)

/etc/resolv.conf
nameserver 127.0.0.1
options edns0 trust-ad

Above have worked perfectly until some update after end of August.

However now i get connection refused.
Doing drill my testdomain returns 127.0.0.1
Curl returns the same.

I created
dns.conf

/etc/NetworkManager/conf.d/dns.conf
[main]
dns=dnsmasq

Restarting systemd-resolved.service fixes the issue temporary where curl will now point to the IP i have selected in dnsmasq.conf while drill will point to 127.0.0.1

So it feels like something has changed since x updates ago and they are fighting on how to resolve.
Any ideas on how to solve this would be great, thanks in advance.

Last edited by Commander (2021-11-15 09:30:23)

Offline

#2 2021-09-29 14:54:16

progandy
Member
Registered: 2012-05-17
Posts: 5,190

Re: [Solved] dnsmasq & systemd-resolved for development domains

I suggest you try "Domains=~localtest.me" without the slash in resolved.conf and remove the networkmanager dns config again.

By the way, there is also https://nip.io where you can define the ip to resolve as part of the domain name.

Last edited by progandy (2021-09-29 15:17:26)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#3 2021-11-15 09:29:56

Commander
Member
Registered: 2011-02-12
Posts: 43

Re: [Solved] dnsmasq & systemd-resolved for development domains

progandy wrote:

I suggest you try "Domains=~localtest.me" without the slash in resolved.conf and remove the networkmanager dns config again.

By the way, there is also https://nip.io where you can define the ip to resolve as part of the domain name.

Seem to have worked. I have noticed that dnsmsq may fail after a suspend/resume so will have to look into that. But these changes seem to have worked.
Regarding dev domains, i know localtest.me is also similar, but changing domain name is not that easy as it should be hmm

Offline

Board footer

Powered by FluxBB