You are not logged in.

#1 2019-06-25 11:26:45

keeely
Member
Registered: 2019-06-23
Posts: 8

[SOLVED] dnsmasq address= option only works for non-dotted names

I've tried to follow the instructions here: https://wiki.archlinux.org/index.php/dnsmasq

I just want to remap some addresses to localhost, so I've created a configuration file:

/etc/dnsmasq.conf

address=/mylocalserver/127.0.0.1
address=/my.local.server/127.0.0.1

When I ping the first address, no problem it behaves exactly as expected:

# ping mylocalserver
PING mylocalserver (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.022 ms

But for the second address:

# ping my.local.server
ping: my.local.server: Name or service not known

Any idea what I'm doing wrong?

Last edited by keeely (2019-06-25 13:01:20)

Offline

#2 2019-06-25 12:42:50

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,500

Re: [SOLVED] dnsmasq address= option only works for non-dotted names

Is there a literal "local" in the name? The resolver might skip the local resolver (avahi/mdns related) - though that shouldn't happen for a .server TLD.
You could also start "dnsmasq -q" and check the  log whether my.local.server is actually requested to dnsmasq.

Offline

#3 2019-06-25 12:43:37

keeely
Member
Registered: 2019-06-23
Posts: 8

Re: [SOLVED] dnsmasq address= option only works for non-dotted names

Also, while following this:  https://wiki.archlinux.org/index.php/Do … esolv.conf
I get this error:

# chattr +i /etc/resolv.conf
chattr: Operation not supported while reading flags on /etc/resolv.conf

Offline

#4 2019-06-25 12:45:28

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,500

Re: [SOLVED] dnsmasq address= option only works for non-dotted names

stat /etc/resolv.conf

symlink? why? do you also use systemd-networkd/resolved??

Offline

#5 2019-06-25 12:46:32

keeely
Member
Registered: 2019-06-23
Posts: 8

Re: [SOLVED] dnsmasq address= option only works for non-dotted names

seth wrote:

Is there a literal "local" in the name? The resolver might skip the local resolver (avahi/mdns related) - though that shouldn't happen for a .server TLD.
You could also start "dnsmasq -q" and check the  log whether my.local.server is actually requested to dnsmasq.

Excellent point.  I've removed 'local', same result.

Offline

#6 2019-06-25 12:46:54

nl6720
The Evil Wiki Admin
Registered: 2016-07-02
Posts: 718

Re: [SOLVED] dnsmasq address= option only works for non-dotted names

Works for me:

$ ping -c4 my.local.server
PING my.local.server (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost.localdomain (127.0.0.1): icmp_seq=1 ttl=64 time=0.074 ms
64 bytes from localhost.localdomain (127.0.0.1): icmp_seq=2 ttl=64 time=0.076 ms
64 bytes from localhost.localdomain (127.0.0.1): icmp_seq=3 ttl=64 time=0.091 ms
64 bytes from localhost.localdomain (127.0.0.1): icmp_seq=4 ttl=64 time=0.096 ms

--- my.local.server ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 31ms
rtt min/avg/max/mdev = 0.074/0.084/0.096/0.011 ms

Post your /etc/resolv.conf and the output of:

$ file /etc/resolv.conf
$ drill my.local.server

Offline

#7 2019-06-25 12:47:40

keeely
Member
Registered: 2019-06-23
Posts: 8

Re: [SOLVED] dnsmasq address= option only works for non-dotted names

seth wrote:
stat /etc/resolv.conf

symlink? why? do you also use systemd-networkd/resolved??

It seems it is:
File: /etc/resolv.conf -> /var/run/systemd/resolve/resolv.conf

I honestly don't know what I'm doing.  This is my first time using systemd, so it may be as much about my lack of understanding of that rather than about Arch.
I've changed /etc/systemd/resolved.conf to set:

DNSStubListener=no

Which I thought was disabling the systemd resolved.

Last edited by keeely (2019-06-25 12:50:30)

Offline

#8 2019-06-25 12:52:50

keeely
Member
Registered: 2019-06-23
Posts: 8

Re: [SOLVED] dnsmasq address= option only works for non-dotted names

nl6720 wrote:

Post your /etc/resolv.conf and the output of:

$ file /etc/resolv.conf
$ drill my.local.server
[root@archlinux etc]# file /etc/resolv.conf
/etc/resolv.conf: symbolic link to /var/run/systemd/resolve/resolv.conf
[root@archlinux etc]# drill my.super.server
;; ->>HEADER<<- opcode: QUERY, rcode: NOERROR, id: 15569
;; flags: qr aa rd ra ; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0 
;; QUESTION SECTION:
;; my.super.server.	IN	A

;; ANSWER SECTION:
my.super.server.	0	IN	A	127.0.0.1

;; AUTHORITY SECTION:

;; ADDITIONAL SECTION:

;; Query time: 0 msec
;; SERVER: 127.0.0.1
;; WHEN: Tue Jun 25 12:50:24 2019
;; MSG SIZE  rcvd: 49

NB: Changed the name to remove 'local'

Offline

#9 2019-06-25 12:52:54

nl6720
The Evil Wiki Admin
Registered: 2016-07-02
Posts: 718

Re: [SOLVED] dnsmasq address= option only works for non-dotted names

Systemd-resolved is not enabled by default nor does it create that symlink by default.
Delete the /etc/resolv.conf symlink and create a new file following https://wiki.archlinux.org/index.php/Dn … forwarding.

Offline

#10 2019-06-25 13:01:05

keeely
Member
Registered: 2019-06-23
Posts: 8

Re: [SOLVED] dnsmasq address= option only works for non-dotted names

nl6720 wrote:

Systemd-resolved is not enabled by default nor does it create that symlink by default.
Delete the /etc/resolv.conf symlink and create a new file following https://wiki.archlinux.org/index.php/Dn … forwarding.

Gotcha.  Yes I think that was my mistake, I somehow enabled resolved.  Working now thank you very much.

Offline

Board footer

Powered by FluxBB