Skip to content

support additional unicast DNS scopes, on top of the primary and the per-link ones #5573

Closed

Description

@akarl10

Submission type

  • Bug report
  • Request for enhancement (RFE)

systemd version the issue has been seen with

232

Used distribution

Ubuntu Zesty developement branch

Before using systemd-resloved I used dnsmasq with split dns and a "route" strongswan ipsec rule
This way I have some kind of what Microsoft calls DirectAccess.

strongswan usually does not provide a vpn interface since ipsec only adds policies how to transport packets (I use ipv6 so there is not even added a seperate vpn ip address, just like DirectAccess does).

Now to the problem: As far as i saw it is only possibe to add dns search domains and dns servers to interfaces, but I did not find a way to set a "global" dns server for a specific domain.

Is there something I oversaw?

Activity

  1. poettering commented on Mar 29, 2017

    @poettering
    Member

    I am not sure I grok what you are asking for. What precisely do you want resolved to do? Please write this down without references to microsoft, strongswan or anything like that as I have no idea what they precisely do.

  2. added
    needs-reporter-feedback ❓
    RFE 🎁
    on Mar 29, 2017
  3. akarl10 commented on Mar 29, 2017

    @akarl10
    Author

    in short:
    I need a way to statically set a domain server for a specific domain
    with dnsmasq I do it with ex:
    server=/intranet/10.17.1.1
    this would query *.intranet using the nameserver 10.71.1.1

  4. removed
    needs-reporter-feedback ❓
    on Mar 29, 2017
  5. gfleury commented on Apr 5, 2017

    @gfleury

    There is anything defined as configuration patterns? I would be glad to implement it.

  6. tohojo commented on May 10, 2017

    @tohojo
    Contributor

    I have a similar use case (IPSEC VPN that doesn't create a separate interface), but I want to add a new DNS server (for any domain). I have been trying to do this via the DBUS interface to systemd-resolved, but it won't let me when the link is managed by systemd-networkd.

    Essentially, what I need is an interface to add and remove extra DNS servers at runtime, even when the link is managed by systemd-networkd.

    Should I open a separate issue for this, or does it fall under this one?

  7. antoinefaure commented on Dec 6, 2018

    @antoinefaure

    Hello,
    Any update on this ?
    I'd be interested as well, I need to tell resolved to use a specific DNS server for a particular domain (*.example.com), but unless I missed something this is not possible yet.

  8. rudiservo commented on Dec 11, 2018

    @rudiservo

    Guys, I know that SystemD has a lot of work to be done, I really appreciate it, but please try and make resolved behaviour has default has it possibly can be then work from there, in comparison do DnsMasq

    Right know things could be solved by making some kind of behaviour bypass to resolve by order of dns entries, something that might be suggested in this issue that got a bit out of hand.
    #5755

    My point is, it is limiting developers and admins functionality over their machines ability to resolve local developments and dns server plus VPN's, right know we cant make things work has we need them to on resolved.

    This issue could be solved by or by mimicking DnsMasq server=/intranet/10.17.1.1
    or
    ResolveBehaviour = topdown, best, default, or something...

    Already did try the resolved.conf.d/example.conf solution but if it fails to resolve I have to restart the resolved service, so it's inconvenient and a nuisance and it should at least be locked to search for these domains on described dns servers or at least have that option
    [Resolve]
    DNS=172.17.0.1
    Domains= ~example

    Thanks in advance, and please just give us an extra option to be able to use resolved has we need it to.

  9. yrro commented on Dec 20, 2018

    @yrro
    Contributor

    I think #11050 will help with this, but it won't be the complete solution. You'll still need a dummy interface that you can set your DNS server and routing domain on.

  10. changed the title [-]split dns without dedicated vpn adapter[/-] [+]support additional unicast DNS scopes, on top of the primary and the per-link ones[/+] on Nov 18, 2020
  11. yrro commented on Oct 13, 2021

    @yrro
    Contributor

    I think #11050 will help with this, but it won't be the complete solution. You'll still need a dummy interface that you can set your DNS server and routing domain on.

    Quick example that works for me:

    #20485 (comment)

  12. tmccombs commented on Mar 14, 2022

    @tmccombs
    Contributor

    It looks like using a dummy interface no longer works, probably due to d301c52.

    If I run:

    $ sudo nmcli connection add con-name dns-test type dummy ifname dummy-dns ipv4.method manual ipv4.addresses 127.0.0.88/32 ipv6.method disable ipv4.dns-search ~example.com ipv4.dns 8.8.8.8
    $ resolvectl status dummy-dns                                                                                                                                                                         at 01:36:01 
    Link 3 (dummy-dns)
        Current Scopes: DNS
             Protocols: -DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
    Current DNS Server: 8.8.8.8
           DNS Servers: 8.8.8.8
            DNS Domain: ~example.com
    

    then try to resovle example.com, either with dig example.com or resolvectl query example.com then I get an error that no name server can be reached.

  13. noraj commented on Jun 29, 2024

    @noraj

    I'm confused why I can't resolve OpenNIC operated TLDs with this configuration:

    # Default resolver, using Quad9
    [Resolve]
    DNS=9.9.9.9#dns.quad9.net 149.112.112.112#dns.quad9.net 2620:fe::fe#dns.quad9.net 2620:fe::9#dns.quad9.net
    Domains=~.
    
    # OpenNIC TLDs
    [Resolve]
    DNS=51.158.108.203 51.77.149.139 2001:41d0:404:200::976
    Domains=~bbs ~chan ~cyb ~dyn ~epic ~geek ~gopher ~indy ~libre ~neo ~null ~o ~oss ~oz ~parody ~pirate
    ➜ resolvectl query be.libre
    be.libre: Name 'be.libre' not found
    
    ➜ resolvectl query grep.geek     
    grep.geek: Name 'grep.geek' not found
    
    ➜ drill grep.geek @51.158.108.203
    ;; ->>HEADER<<- opcode: QUERY, rcode: NOERROR, id: 21748
    ;; flags: qr rd ra ; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0 
    ;; QUESTION SECTION:
    ;; grep.geek.   IN      A
    
    ;; ANSWER SECTION:
    grep.geek.      27700   IN      A       161.97.219.84
    
    ;; AUTHORITY SECTION:
    
    ;; ADDITIONAL SECTION:
    
    ;; Query time: 61 msec
    ;; SERVER: 51.158.108.203
    ;; WHEN: Sat Jun 29 22:21:56 2024
    ;; MSG SIZE  rcvd: 43
    
    ➜ drill be.libre @51.158.108.203 
    ;; ->>HEADER<<- opcode: QUERY, rcode: NOERROR, id: 55108
    ;; flags: qr rd ra ; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0 
    ;; QUESTION SECTION:
    ;; be.libre.    IN      A
    
    ;; ANSWER SECTION:
    be.libre.       3600    IN      A       161.97.219.84
    
    ;; AUTHORITY SECTION:
    
    ;; ADDITIONAL SECTION:
    
    ;; Query time: 176 msec
    ;; SERVER: 51.158.108.203
    ;; WHEN: Sat Jun 29 22:22:03 2024
    ;; MSG SIZE  rcvd: 42
    

    Does ~ works only for domains and not TLDs? Or is it because OpenNIC TLDs are non-standard (not on ICANN) nor are special-use TLDs?

  14. 1 remaining item

  15. noraj commented on Aug 21, 2024

    @noraj

    Are both those configuration blocks in the same file?

    Yes they are.

    Doesn't the second one overwrite the first one?

    No, else I couldn't resolve any domain on Internet.

    Can you run resolvectl status to inspect the state of resolved with this configuration in place?

    ➜ resolvectl status
    Global
               Protocols: -LLMNR -mDNS DNSOverTLS=opportunistic DNSSEC=no/unsupported
        resolv.conf mode: stub
      Current DNS Server: 149.112.112.112#dns.quad9.net
             DNS Servers: 9.9.9.9#dns.quad9.net 149.112.112.112#dns.quad9.net 2620:fe::fe#dns.quad9.net 2620:fe::9#dns.quad9.net 51.158.108.203 51.77.149.139 2001:41d0:404:200::976
    Fallback DNS Servers: 1.1.1.1#cloudflare-dns.com 9.9.9.9#dns.quad9.net 8.8.8.8#dns.google 2606:4700:4700::1111#cloudflare-dns.com 2620:fe::9#dns.quad9.net 2001:4860:4860::8888#dns.google
              DNS Domain: ~. ~bbs ~chan ~cyb ~dyn ~epic ~geek ~gopher ~indy ~libre ~neo ~null ~o ~oss ~oz ~parody ~pirate
    
    Link 2 (enp9s0)
        Current Scopes: none
             Protocols: -DefaultRoute -LLMNR -mDNS DNSOverTLS=opportunistic DNSSEC=no/unsupported
    
    Link 4 (virbr1)
        Current Scopes: none
             Protocols: -DefaultRoute -LLMNR -mDNS DNSOverTLS=opportunistic DNSSEC=no/unsupported
    
    Link 15 (enp2s0f0u8)
        Current Scopes: none
             Protocols: -DefaultRoute -LLMNR -mDNS DNSOverTLS=opportunistic DNSSEC=no/unsupported
    
  16. yrro commented on Aug 21, 2024

    @yrro
    Contributor

    Oh I see - the final value of DNS= and Servers= includes all values specified in the config file.

  17. akarl10 commented on Aug 21, 2024

    @akarl10
    Author

    I understand that for you a static configuration would be preferrable, but what I do as a workaround (not for opennic, but the following is an example that may work for you) running a script/service that does something like this:

    #!/bin/sh
    ip l a dns-opennic type dummy
    ip l s dns-opennic up
    ip -6 a a fe80::53/64 dev dns-opennic
    resolvectl dns dns-opennic 51.158.108.203 51.77.149.139 2001:41d0:404:200::976
    resolvectl domain dns-opennic ~bbs ~chan ~cyb ~dyn ~epic ~geek ~gopher ~indy ~libre ~neo ~null ~o ~oss ~oz ~parody ~pirate
    resolvectl default-route dns-opennic false
    #make networkmanager not showing a popup that a new device is up
    nmcli device set dns-opennic 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
    ip -6 a a ::2/128 dev dns-opennic
    sleep 0.2
    ip -6 a d ::2/128 dev dns-opennic

    unapplying this would simply be ip l d dns-opennic

  18. yrro commented on Aug 29, 2024

    @yrro
    Contributor

    I understand that for you a static configuration would be preferrable, but what I do as a workaround (not for opennic, but the following is an example that may work for you) running a script/service that does something like this:

    Worth noting that the dummy interface workaround requires v256.

  19. added 2 commits that reference this issue on Sep 11, 2024
    b1bc477
    da1b3c5
  20. added 7 commits that reference this issue on May 8, 2025
    d4a502e
    f4eb134
    76ac08d
    26bcb66
    d6c7d99
    793513d
    7928c0e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    RFE 🎁resolve

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions