How to persist “systemd-resolve” configuration for a particular network interface?












1















I have upgraded my Ubuntu Desktop to Bionic Beaver, which switched to systemd-resolve. With that change, the LXD DNS resolution stopped working.



In order to make LXD containers discoverable, I can run the below command. Note, the IP 10.78.38.1 is the IP of the lxdbr0 bridge.



$ sudo systemd-resolve --interface lxdbr0 --set-dns 10.78.38.1 --set-domain lxd


With this in place, I can discover LXD container by their name and the configuration looks as follows.



$ systemd-resolve --status
.
.
.
Link 10 (lxdbr0)
Current Scopes: DNS
LLMNR setting: yes
MulticastDNS setting: no
DNSSEC setting: no
DNSSEC supported: no
DNS Servers: 10.78.38.1
DNS Domain: lxd
.
.
.


However, after a system reboot, this configuration is gone.



$ systemd-resolve --status
.
.
.
Link 10 (lxdbr0)
Current Scopes: none
LLMNR setting: yes
MulticastDNS setting: no
DNSSEC setting: no
DNSSEC supported: no
.
.
.


In order to make the above persistent, I have reviewed the systemd-resolve manpage http://manpages.ubuntu.com/manpages/bionic/man8/systemd-resolved.service.8.html. It suggests to create a /etc/systemd/resolved.conf.d/lxd.conf file but there are no parameters available that would allow me to make such configuration specific to one particular NIC.










share|improve this question



























    1















    I have upgraded my Ubuntu Desktop to Bionic Beaver, which switched to systemd-resolve. With that change, the LXD DNS resolution stopped working.



    In order to make LXD containers discoverable, I can run the below command. Note, the IP 10.78.38.1 is the IP of the lxdbr0 bridge.



    $ sudo systemd-resolve --interface lxdbr0 --set-dns 10.78.38.1 --set-domain lxd


    With this in place, I can discover LXD container by their name and the configuration looks as follows.



    $ systemd-resolve --status
    .
    .
    .
    Link 10 (lxdbr0)
    Current Scopes: DNS
    LLMNR setting: yes
    MulticastDNS setting: no
    DNSSEC setting: no
    DNSSEC supported: no
    DNS Servers: 10.78.38.1
    DNS Domain: lxd
    .
    .
    .


    However, after a system reboot, this configuration is gone.



    $ systemd-resolve --status
    .
    .
    .
    Link 10 (lxdbr0)
    Current Scopes: none
    LLMNR setting: yes
    MulticastDNS setting: no
    DNSSEC setting: no
    DNSSEC supported: no
    .
    .
    .


    In order to make the above persistent, I have reviewed the systemd-resolve manpage http://manpages.ubuntu.com/manpages/bionic/man8/systemd-resolved.service.8.html. It suggests to create a /etc/systemd/resolved.conf.d/lxd.conf file but there are no parameters available that would allow me to make such configuration specific to one particular NIC.










    share|improve this question

























      1












      1








      1








      I have upgraded my Ubuntu Desktop to Bionic Beaver, which switched to systemd-resolve. With that change, the LXD DNS resolution stopped working.



      In order to make LXD containers discoverable, I can run the below command. Note, the IP 10.78.38.1 is the IP of the lxdbr0 bridge.



      $ sudo systemd-resolve --interface lxdbr0 --set-dns 10.78.38.1 --set-domain lxd


      With this in place, I can discover LXD container by their name and the configuration looks as follows.



      $ systemd-resolve --status
      .
      .
      .
      Link 10 (lxdbr0)
      Current Scopes: DNS
      LLMNR setting: yes
      MulticastDNS setting: no
      DNSSEC setting: no
      DNSSEC supported: no
      DNS Servers: 10.78.38.1
      DNS Domain: lxd
      .
      .
      .


      However, after a system reboot, this configuration is gone.



      $ systemd-resolve --status
      .
      .
      .
      Link 10 (lxdbr0)
      Current Scopes: none
      LLMNR setting: yes
      MulticastDNS setting: no
      DNSSEC setting: no
      DNSSEC supported: no
      .
      .
      .


      In order to make the above persistent, I have reviewed the systemd-resolve manpage http://manpages.ubuntu.com/manpages/bionic/man8/systemd-resolved.service.8.html. It suggests to create a /etc/systemd/resolved.conf.d/lxd.conf file but there are no parameters available that would allow me to make such configuration specific to one particular NIC.










      share|improve this question














      I have upgraded my Ubuntu Desktop to Bionic Beaver, which switched to systemd-resolve. With that change, the LXD DNS resolution stopped working.



      In order to make LXD containers discoverable, I can run the below command. Note, the IP 10.78.38.1 is the IP of the lxdbr0 bridge.



      $ sudo systemd-resolve --interface lxdbr0 --set-dns 10.78.38.1 --set-domain lxd


      With this in place, I can discover LXD container by their name and the configuration looks as follows.



      $ systemd-resolve --status
      .
      .
      .
      Link 10 (lxdbr0)
      Current Scopes: DNS
      LLMNR setting: yes
      MulticastDNS setting: no
      DNSSEC setting: no
      DNSSEC supported: no
      DNS Servers: 10.78.38.1
      DNS Domain: lxd
      .
      .
      .


      However, after a system reboot, this configuration is gone.



      $ systemd-resolve --status
      .
      .
      .
      Link 10 (lxdbr0)
      Current Scopes: none
      LLMNR setting: yes
      MulticastDNS setting: no
      DNSSEC setting: no
      DNSSEC supported: no
      .
      .
      .


      In order to make the above persistent, I have reviewed the systemd-resolve manpage http://manpages.ubuntu.com/manpages/bionic/man8/systemd-resolved.service.8.html. It suggests to create a /etc/systemd/resolved.conf.d/lxd.conf file but there are no parameters available that would allow me to make such configuration specific to one particular NIC.







      linux networking ubuntu dns resolv.conf






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked May 12 '18 at 9:24









      quatquat

      25638




      25638






















          2 Answers
          2






          active

          oldest

          votes


















          1














          I realize this question has been here 2 months, but maybe you still need some answers?



          1) Systemd-networkd store network configurations in (at least) 3 directories, maybe more. The one that seems most relevant to you is:



          /etc/systemd/network/ 


          (it overrides the other 2, namely /lib/s/n and /run/s/n.



          Create a text file similar to this:



          [Match]
          Name=enp0s4

          [Network]
          DHCP=yes
          DNS=192.168.1.1


          You can name it what you want it seems as long as it is in that directory, mine is called enp0s4.network, getting the content right is critical, if you get it wrong, bad things happen, like your networking stops working, at least on that interface, until you restore a working config. Which is not easy, I messed up mine and it took me like an hour to sort it out. Good thing my "server" is in the next room, not in a remote data center!



          For examples how to set up a bridge, read from here on:



          man systemd.network |grep -A 42 "Example 3"


          The examples given there plus my snippet of code can set up:



          Current Scopes: DNS
          LLMNR setting: yes
          MulticastDNS setting: no
          DNSSEC setting: no
          DNSSEC supported: no
          DNS Servers: 10.78.38.1


          Not sure what the syntax is for DNS domain, it should be possible, the man page is like 30 pages long! If you can, skip it, trying "Domain=" screwed up my system, that's how I know getting it wrong is bad, personal experience. :-) So find the right syntax, or don't put it in unless you can recover.



          Recovery is another post, though I'm tired.



          Here are refernces I used:



          How to check if the network is running:
          https://superuser.com/questions/1187633/how-to-debug-systemd-networkd?rq=1#comment1807294_1187633



          How to enable if it's disabled:
          https://askubuntu.com/posts/681768/revisions



          Restart systemd-resolver without reboot:



          sudo systemctl restart systemd-resolved


          FYI: there is a way to tell systemd to let Network-Manager handle an interface, as well as leave it "unmanaged" and run with flat file configurations like /etc/resolv.conf. But I'd make it work as is if I were in your shoes. And I am, I'm just trying to configure different interfaces for another purpose, but I needed all that info. above to help myself, so I thought I'd share. Since you shared how to change it temporarily, which is also useful. :-)



          HTH






          share|improve this answer































            1














            This sounds plausible but has does not seem to have any effect:



            According to the linked manpage man 8 systemd-resolved.service, you have to use the per link configuration file in /etc/systemd/network:




            The DNS servers contacted are determined from the global settings in /etc/systemd/resolved.conf, the per-link static settings in /etc/systemd/network/*.network files, the per-link dynamic settings received over DHCP and any DNS server information made available by other system services.




            To make your configuration persistent, you have to create the file /etc/systemd/network/lxdbr0.conf:



            [Match]
            Name=lxdbr0

            [Resolve]
            DNS=10.78.38.1
            Domains=lxd





            share|improve this answer


























            • This sounds plausible but this setting does not seem to have any effect on my system with LXD. After posting the initial question, I had created a Systemd service that executes the aforementioned command in order to configure DNS for LXD, which runs on boot. That does not reliably work either, since the lxdbr0 interface sometimes does not exist yet at that point in time. I therefore have to start the custom Systemd service manually. I guess, this might also be the reason for your solution not to work with LXD although it appears to be the right way to go...

              – quat
              Oct 12 '18 at 11:01











            • You are right. But somehow I managed to get the desired output from systemd-resolve --status without entering that command. The other problem is, that name resolving does not work inside containers. I will fix my answer, if I find a better solution.

              – ctx
              Oct 12 '18 at 11:57












            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "3"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1322045%2fhow-to-persist-systemd-resolve-configuration-for-a-particular-network-interfac%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            1














            I realize this question has been here 2 months, but maybe you still need some answers?



            1) Systemd-networkd store network configurations in (at least) 3 directories, maybe more. The one that seems most relevant to you is:



            /etc/systemd/network/ 


            (it overrides the other 2, namely /lib/s/n and /run/s/n.



            Create a text file similar to this:



            [Match]
            Name=enp0s4

            [Network]
            DHCP=yes
            DNS=192.168.1.1


            You can name it what you want it seems as long as it is in that directory, mine is called enp0s4.network, getting the content right is critical, if you get it wrong, bad things happen, like your networking stops working, at least on that interface, until you restore a working config. Which is not easy, I messed up mine and it took me like an hour to sort it out. Good thing my "server" is in the next room, not in a remote data center!



            For examples how to set up a bridge, read from here on:



            man systemd.network |grep -A 42 "Example 3"


            The examples given there plus my snippet of code can set up:



            Current Scopes: DNS
            LLMNR setting: yes
            MulticastDNS setting: no
            DNSSEC setting: no
            DNSSEC supported: no
            DNS Servers: 10.78.38.1


            Not sure what the syntax is for DNS domain, it should be possible, the man page is like 30 pages long! If you can, skip it, trying "Domain=" screwed up my system, that's how I know getting it wrong is bad, personal experience. :-) So find the right syntax, or don't put it in unless you can recover.



            Recovery is another post, though I'm tired.



            Here are refernces I used:



            How to check if the network is running:
            https://superuser.com/questions/1187633/how-to-debug-systemd-networkd?rq=1#comment1807294_1187633



            How to enable if it's disabled:
            https://askubuntu.com/posts/681768/revisions



            Restart systemd-resolver without reboot:



            sudo systemctl restart systemd-resolved


            FYI: there is a way to tell systemd to let Network-Manager handle an interface, as well as leave it "unmanaged" and run with flat file configurations like /etc/resolv.conf. But I'd make it work as is if I were in your shoes. And I am, I'm just trying to configure different interfaces for another purpose, but I needed all that info. above to help myself, so I thought I'd share. Since you shared how to change it temporarily, which is also useful. :-)



            HTH






            share|improve this answer




























              1














              I realize this question has been here 2 months, but maybe you still need some answers?



              1) Systemd-networkd store network configurations in (at least) 3 directories, maybe more. The one that seems most relevant to you is:



              /etc/systemd/network/ 


              (it overrides the other 2, namely /lib/s/n and /run/s/n.



              Create a text file similar to this:



              [Match]
              Name=enp0s4

              [Network]
              DHCP=yes
              DNS=192.168.1.1


              You can name it what you want it seems as long as it is in that directory, mine is called enp0s4.network, getting the content right is critical, if you get it wrong, bad things happen, like your networking stops working, at least on that interface, until you restore a working config. Which is not easy, I messed up mine and it took me like an hour to sort it out. Good thing my "server" is in the next room, not in a remote data center!



              For examples how to set up a bridge, read from here on:



              man systemd.network |grep -A 42 "Example 3"


              The examples given there plus my snippet of code can set up:



              Current Scopes: DNS
              LLMNR setting: yes
              MulticastDNS setting: no
              DNSSEC setting: no
              DNSSEC supported: no
              DNS Servers: 10.78.38.1


              Not sure what the syntax is for DNS domain, it should be possible, the man page is like 30 pages long! If you can, skip it, trying "Domain=" screwed up my system, that's how I know getting it wrong is bad, personal experience. :-) So find the right syntax, or don't put it in unless you can recover.



              Recovery is another post, though I'm tired.



              Here are refernces I used:



              How to check if the network is running:
              https://superuser.com/questions/1187633/how-to-debug-systemd-networkd?rq=1#comment1807294_1187633



              How to enable if it's disabled:
              https://askubuntu.com/posts/681768/revisions



              Restart systemd-resolver without reboot:



              sudo systemctl restart systemd-resolved


              FYI: there is a way to tell systemd to let Network-Manager handle an interface, as well as leave it "unmanaged" and run with flat file configurations like /etc/resolv.conf. But I'd make it work as is if I were in your shoes. And I am, I'm just trying to configure different interfaces for another purpose, but I needed all that info. above to help myself, so I thought I'd share. Since you shared how to change it temporarily, which is also useful. :-)



              HTH






              share|improve this answer


























                1












                1








                1







                I realize this question has been here 2 months, but maybe you still need some answers?



                1) Systemd-networkd store network configurations in (at least) 3 directories, maybe more. The one that seems most relevant to you is:



                /etc/systemd/network/ 


                (it overrides the other 2, namely /lib/s/n and /run/s/n.



                Create a text file similar to this:



                [Match]
                Name=enp0s4

                [Network]
                DHCP=yes
                DNS=192.168.1.1


                You can name it what you want it seems as long as it is in that directory, mine is called enp0s4.network, getting the content right is critical, if you get it wrong, bad things happen, like your networking stops working, at least on that interface, until you restore a working config. Which is not easy, I messed up mine and it took me like an hour to sort it out. Good thing my "server" is in the next room, not in a remote data center!



                For examples how to set up a bridge, read from here on:



                man systemd.network |grep -A 42 "Example 3"


                The examples given there plus my snippet of code can set up:



                Current Scopes: DNS
                LLMNR setting: yes
                MulticastDNS setting: no
                DNSSEC setting: no
                DNSSEC supported: no
                DNS Servers: 10.78.38.1


                Not sure what the syntax is for DNS domain, it should be possible, the man page is like 30 pages long! If you can, skip it, trying "Domain=" screwed up my system, that's how I know getting it wrong is bad, personal experience. :-) So find the right syntax, or don't put it in unless you can recover.



                Recovery is another post, though I'm tired.



                Here are refernces I used:



                How to check if the network is running:
                https://superuser.com/questions/1187633/how-to-debug-systemd-networkd?rq=1#comment1807294_1187633



                How to enable if it's disabled:
                https://askubuntu.com/posts/681768/revisions



                Restart systemd-resolver without reboot:



                sudo systemctl restart systemd-resolved


                FYI: there is a way to tell systemd to let Network-Manager handle an interface, as well as leave it "unmanaged" and run with flat file configurations like /etc/resolv.conf. But I'd make it work as is if I were in your shoes. And I am, I'm just trying to configure different interfaces for another purpose, but I needed all that info. above to help myself, so I thought I'd share. Since you shared how to change it temporarily, which is also useful. :-)



                HTH






                share|improve this answer













                I realize this question has been here 2 months, but maybe you still need some answers?



                1) Systemd-networkd store network configurations in (at least) 3 directories, maybe more. The one that seems most relevant to you is:



                /etc/systemd/network/ 


                (it overrides the other 2, namely /lib/s/n and /run/s/n.



                Create a text file similar to this:



                [Match]
                Name=enp0s4

                [Network]
                DHCP=yes
                DNS=192.168.1.1


                You can name it what you want it seems as long as it is in that directory, mine is called enp0s4.network, getting the content right is critical, if you get it wrong, bad things happen, like your networking stops working, at least on that interface, until you restore a working config. Which is not easy, I messed up mine and it took me like an hour to sort it out. Good thing my "server" is in the next room, not in a remote data center!



                For examples how to set up a bridge, read from here on:



                man systemd.network |grep -A 42 "Example 3"


                The examples given there plus my snippet of code can set up:



                Current Scopes: DNS
                LLMNR setting: yes
                MulticastDNS setting: no
                DNSSEC setting: no
                DNSSEC supported: no
                DNS Servers: 10.78.38.1


                Not sure what the syntax is for DNS domain, it should be possible, the man page is like 30 pages long! If you can, skip it, trying "Domain=" screwed up my system, that's how I know getting it wrong is bad, personal experience. :-) So find the right syntax, or don't put it in unless you can recover.



                Recovery is another post, though I'm tired.



                Here are refernces I used:



                How to check if the network is running:
                https://superuser.com/questions/1187633/how-to-debug-systemd-networkd?rq=1#comment1807294_1187633



                How to enable if it's disabled:
                https://askubuntu.com/posts/681768/revisions



                Restart systemd-resolver without reboot:



                sudo systemctl restart systemd-resolved


                FYI: there is a way to tell systemd to let Network-Manager handle an interface, as well as leave it "unmanaged" and run with flat file configurations like /etc/resolv.conf. But I'd make it work as is if I were in your shoes. And I am, I'm just trying to configure different interfaces for another purpose, but I needed all that info. above to help myself, so I thought I'd share. Since you shared how to change it temporarily, which is also useful. :-)



                HTH







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Jul 21 '18 at 15:24









                Lubo DiakovLubo Diakov

                111




                111

























                    1














                    This sounds plausible but has does not seem to have any effect:



                    According to the linked manpage man 8 systemd-resolved.service, you have to use the per link configuration file in /etc/systemd/network:




                    The DNS servers contacted are determined from the global settings in /etc/systemd/resolved.conf, the per-link static settings in /etc/systemd/network/*.network files, the per-link dynamic settings received over DHCP and any DNS server information made available by other system services.




                    To make your configuration persistent, you have to create the file /etc/systemd/network/lxdbr0.conf:



                    [Match]
                    Name=lxdbr0

                    [Resolve]
                    DNS=10.78.38.1
                    Domains=lxd





                    share|improve this answer


























                    • This sounds plausible but this setting does not seem to have any effect on my system with LXD. After posting the initial question, I had created a Systemd service that executes the aforementioned command in order to configure DNS for LXD, which runs on boot. That does not reliably work either, since the lxdbr0 interface sometimes does not exist yet at that point in time. I therefore have to start the custom Systemd service manually. I guess, this might also be the reason for your solution not to work with LXD although it appears to be the right way to go...

                      – quat
                      Oct 12 '18 at 11:01











                    • You are right. But somehow I managed to get the desired output from systemd-resolve --status without entering that command. The other problem is, that name resolving does not work inside containers. I will fix my answer, if I find a better solution.

                      – ctx
                      Oct 12 '18 at 11:57
















                    1














                    This sounds plausible but has does not seem to have any effect:



                    According to the linked manpage man 8 systemd-resolved.service, you have to use the per link configuration file in /etc/systemd/network:




                    The DNS servers contacted are determined from the global settings in /etc/systemd/resolved.conf, the per-link static settings in /etc/systemd/network/*.network files, the per-link dynamic settings received over DHCP and any DNS server information made available by other system services.




                    To make your configuration persistent, you have to create the file /etc/systemd/network/lxdbr0.conf:



                    [Match]
                    Name=lxdbr0

                    [Resolve]
                    DNS=10.78.38.1
                    Domains=lxd





                    share|improve this answer


























                    • This sounds plausible but this setting does not seem to have any effect on my system with LXD. After posting the initial question, I had created a Systemd service that executes the aforementioned command in order to configure DNS for LXD, which runs on boot. That does not reliably work either, since the lxdbr0 interface sometimes does not exist yet at that point in time. I therefore have to start the custom Systemd service manually. I guess, this might also be the reason for your solution not to work with LXD although it appears to be the right way to go...

                      – quat
                      Oct 12 '18 at 11:01











                    • You are right. But somehow I managed to get the desired output from systemd-resolve --status without entering that command. The other problem is, that name resolving does not work inside containers. I will fix my answer, if I find a better solution.

                      – ctx
                      Oct 12 '18 at 11:57














                    1












                    1








                    1







                    This sounds plausible but has does not seem to have any effect:



                    According to the linked manpage man 8 systemd-resolved.service, you have to use the per link configuration file in /etc/systemd/network:




                    The DNS servers contacted are determined from the global settings in /etc/systemd/resolved.conf, the per-link static settings in /etc/systemd/network/*.network files, the per-link dynamic settings received over DHCP and any DNS server information made available by other system services.




                    To make your configuration persistent, you have to create the file /etc/systemd/network/lxdbr0.conf:



                    [Match]
                    Name=lxdbr0

                    [Resolve]
                    DNS=10.78.38.1
                    Domains=lxd





                    share|improve this answer















                    This sounds plausible but has does not seem to have any effect:



                    According to the linked manpage man 8 systemd-resolved.service, you have to use the per link configuration file in /etc/systemd/network:




                    The DNS servers contacted are determined from the global settings in /etc/systemd/resolved.conf, the per-link static settings in /etc/systemd/network/*.network files, the per-link dynamic settings received over DHCP and any DNS server information made available by other system services.




                    To make your configuration persistent, you have to create the file /etc/systemd/network/lxdbr0.conf:



                    [Match]
                    Name=lxdbr0

                    [Resolve]
                    DNS=10.78.38.1
                    Domains=lxd






                    share|improve this answer














                    share|improve this answer



                    share|improve this answer








                    edited Oct 12 '18 at 11:58

























                    answered Oct 11 '18 at 12:12









                    ctxctx

                    1114




                    1114













                    • This sounds plausible but this setting does not seem to have any effect on my system with LXD. After posting the initial question, I had created a Systemd service that executes the aforementioned command in order to configure DNS for LXD, which runs on boot. That does not reliably work either, since the lxdbr0 interface sometimes does not exist yet at that point in time. I therefore have to start the custom Systemd service manually. I guess, this might also be the reason for your solution not to work with LXD although it appears to be the right way to go...

                      – quat
                      Oct 12 '18 at 11:01











                    • You are right. But somehow I managed to get the desired output from systemd-resolve --status without entering that command. The other problem is, that name resolving does not work inside containers. I will fix my answer, if I find a better solution.

                      – ctx
                      Oct 12 '18 at 11:57



















                    • This sounds plausible but this setting does not seem to have any effect on my system with LXD. After posting the initial question, I had created a Systemd service that executes the aforementioned command in order to configure DNS for LXD, which runs on boot. That does not reliably work either, since the lxdbr0 interface sometimes does not exist yet at that point in time. I therefore have to start the custom Systemd service manually. I guess, this might also be the reason for your solution not to work with LXD although it appears to be the right way to go...

                      – quat
                      Oct 12 '18 at 11:01











                    • You are right. But somehow I managed to get the desired output from systemd-resolve --status without entering that command. The other problem is, that name resolving does not work inside containers. I will fix my answer, if I find a better solution.

                      – ctx
                      Oct 12 '18 at 11:57

















                    This sounds plausible but this setting does not seem to have any effect on my system with LXD. After posting the initial question, I had created a Systemd service that executes the aforementioned command in order to configure DNS for LXD, which runs on boot. That does not reliably work either, since the lxdbr0 interface sometimes does not exist yet at that point in time. I therefore have to start the custom Systemd service manually. I guess, this might also be the reason for your solution not to work with LXD although it appears to be the right way to go...

                    – quat
                    Oct 12 '18 at 11:01





                    This sounds plausible but this setting does not seem to have any effect on my system with LXD. After posting the initial question, I had created a Systemd service that executes the aforementioned command in order to configure DNS for LXD, which runs on boot. That does not reliably work either, since the lxdbr0 interface sometimes does not exist yet at that point in time. I therefore have to start the custom Systemd service manually. I guess, this might also be the reason for your solution not to work with LXD although it appears to be the right way to go...

                    – quat
                    Oct 12 '18 at 11:01













                    You are right. But somehow I managed to get the desired output from systemd-resolve --status without entering that command. The other problem is, that name resolving does not work inside containers. I will fix my answer, if I find a better solution.

                    – ctx
                    Oct 12 '18 at 11:57





                    You are right. But somehow I managed to get the desired output from systemd-resolve --status without entering that command. The other problem is, that name resolving does not work inside containers. I will fix my answer, if I find a better solution.

                    – ctx
                    Oct 12 '18 at 11:57


















                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Super User!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1322045%2fhow-to-persist-systemd-resolve-configuration-for-a-particular-network-interfac%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    How do I know what Microsoft account the skydrive app is syncing to?

                    When does type information flow backwards in C++?

                    Grease: Live!