You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
It is no longer possible to use a dummy interface to configure additional DNS scopes #32022
If I configure the name servers for a dummy network interface, with systemd-resolved, then make a DNS request that would resolve using that interface, I would expect it to use the configured nameservers, even if the address should be routed over another interface.
Unexpected behaviour you saw
If I do a DNS resolution on a domain that is configured to go to the dummy inteface, it appears that it instead goes to the default interface for DNS resolution.
I am using v256 and for me the only thing i had to do is adding an ip address to the dummy interface that is scope global for just a moment. after that Current DNS Server showed up
something like this (replace 1.2.3.4 and privatetld):
ip l a dns-route type dummy
ip l s dns-route up
resolvectl dns dns-route 1.2.3.4
resolvectl domain dns-route ~privatetld
resolvectl default-route dns-route false#make networkmanager not showing a popup that a new device is up
nmcli device set dns-route managed no
#just to make resolvectl take this interface. ::1 does not work, but ::2 should not interfere with something the next 0.2 seconds. not using ipv4 since that might interfere with routing
ip -6 a a ::2/128 dev dns-route
sleep 0.2
ip -6 a d ::2/128 dev dns-route
a more sophisticated way (a snippet that I use in a script) might be this:
# DNS Server is the dns server to use# DNSDOMAIN is the VPN Domain# NLAHost is the hostname that is under DNSDOMAIN but is used for location awareness. May be removed if not needed
ip l a dns-$DNSDOMAINtype dummy
ip l s dns-$DNSDOMAIN up
ip -6 a a fe80::53/64 dev dns-$DNSDOMAIN
resolvectl dns dns-$DNSDOMAIN [fe80::53]:53535%dns-$DNSDOMAIN
resolvectl domain dns-$DNSDOMAIN~$DNSDOMAIN
resolvectl default-route dns-$DNSDOMAINfalse
nmcli device set dns-$DNSDOMAIN managed no
dnsmasq --server=/$DNSDOMAIN/$DNSSERVER'--server=/'$NLAHost'/#' --resolv-file=/run/systemd/resolve/resolv.conf --pid-file=/run/dns-$DNSDOMAIN-dnsmasq.pid --port=53535 --listen-address=fe80::53
#just to make resolvectl take this interface
ip -6 a a ::2/128 dev dns-$DNSDOMAIN
sleep 0.2
ip -6 a d ::2/128 dev dns-$DNSDOMAIN
takedown of the above
ip l sh dns-$DNSDOMAIN>/dev/null 2>/dev/null && (
ip l d dns-$DNSDOMAINtest -e /run/dns-$DNSDOMAIN-dnsmasq.pid &&kill -4 $( cat /run/dns-$DNSDOMAIN-dnsmasq.pid )
)
I tried something like the first snippet on systemd 256:
sudo ip l a dns-route type dummy
sudo ip l s dns-route up
sudo resolvectl dns dns-route 127.0.0.2:9053
sudo resolvectl domain dns-route ~internal
sudo resolvectl default-route dns-route false
sudo ip -6 a a ::2/128 dev dns-route
sleep 0.2
sudo ip -6 a a ::2/128 dev dns-route
but then when I run resolvectl query test.internal, I get back:
test.internal: Name 'test.internal' not found
Your second snippet has some significant differences from the first one:
The dns server is a link-local address bound to the dummy interface, not an address on a different interface
It looks like you are running dnsmasq, listening on the dummy interface, to forward queries to the actual dns server
But I still can't get it to work, and having to run a separate dns resolver to forward to the actual one I want, kind of defeats the purpose of using a dummy interface in order to create a dns scope.
To be clear, the status does show the server as the "Current DNS Server" but it fails to actually do any lookups.
I was eventually able to get something working (kind of) if I used dnsmasq listenign directly on the dummy interface as the server, however:
Why do I need to use a global scope instead of link scope for it to work?
It was remarkably slow. It took over 8 seconds to do a lookup. If I did a query directly to the dummy interface with dig, the response was instantaneous.
@tmccombs I use dnsmasq because I need to except some queries from the link zone (x.tld must go to "default" dns butt everything else in .tld must go to the link dns)
If I would not need that I would use the first one (I tested it with opennic and it worked)
I don't seem to have dnssec enabled in any form, but that might interfere.
in theory resolvectl dnssec <interface> false and resolvectl nta <interface> <custom dns domain> should disable this.
A link is relevant for non-multicast traffic if it isn't a loopback device, has a link beat, and has at least one routable address -> this means that links/interfaces that have only fe80::/64 addresses and 127.0.0.1/::1 do not work (if the latter are even assignable to a non lo interface)
Activity
rpigott commentedon Apr 4, 2024
I don't suppose this was remedied by #31557?
yrro commentedon Aug 21, 2024
Looks like this is present in v256. I don't understand the remarks about kernel versions, is a particular kernel fix required to test this?
akarl10 commentedon Aug 21, 2024
I am using v256 and for me the only thing i had to do is adding an ip address to the dummy interface that is scope global for just a moment. after that
Current DNS Servershowed upsomething like this (replace 1.2.3.4 and privatetld):
a more sophisticated way (a snippet that I use in a script) might be this:
takedown of the above
tmccombs commentedon Aug 29, 2024
I tried something like the first snippet on systemd 256:
And in a separate terminal I have
running.
but then when I run
resolvectl query test.internal, I get back:Your second snippet has some significant differences from the first one:
But I still can't get it to work, and having to run a separate dns resolver to forward to the actual one I want, kind of defeats the purpose of using a dummy interface in order to create a dns scope.
To be clear, the status does show the server as the "Current DNS Server" but it fails to actually do any lookups.
I was eventually able to get something working (kind of) if I used dnsmasq listenign directly on the dummy interface as the server, however:
akarl10 commentedon Aug 29, 2024
@tmccombs I use dnsmasq because I need to except some queries from the link zone (x.tld must go to "default" dns butt everything else in .tld must go to the link dns)
If I would not need that I would use the first one (I tested it with opennic and it worked)
I don't seem to have dnssec enabled in any form, but that might interfere.
in theory
resolvectl dnssec <interface> falseandresolvectl nta <interface> <custom dns domain>should disable this.I have not configured any global scope dns server, only link local
If you refer to
::2/128, for the interface, see https://github.com/systemd/systemd/blob/1e17e48b96bb509754a0a11ea8bd0394965564c6/src/resolve/resolved-link.c#L671C1-L675C42A link is relevant for non-multicast traffic if it isn't a loopback device, has a link beat, and has at least one routable address -> this means that links/interfaces that have only fe80::/64 addresses and 127.0.0.1/::1 do not work (if the latter are even assignable to a non lo interface)
resolved: add concept of delegating lookups below certain domains to …
resolved: add concept of delegating lookups below certain domains to …
resolved: add concept of delegating lookups below certain domains to …
resolved: add concept of delegating lookups below certain domains to …
resolved: add concept of delegating lookups below certain domains to …
resolved: add concept of delegating lookups below certain domains to …
resolved: add concept of delegating lookups below certain domains to …
resolved: add concept of delegating lookups below certain domains to …
resolved: add concept of delegating lookups below certain domains to …
resolved: add new "DNS Delegate" concepts (#34368)
fix(dns): route *.openreplay.cloud via Cloudflare using NM dispatcher