Alpine Linux sometimes DNS is not resolved

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












Sometimes when I run the commands:



sudo apk update && sudo apk upgrade


Over Alpine linux fails to update the packages even if connected to internet. But if I do sudo su "echo 'nameserver 8.8.8.8' > /etc/resolv.conf" I manage to dowload them. But this solution:



  • Causes me frustration I need to set dns all over the time.

  • Sometimes /etc/resolv.conf gets overriden by itself.

How I can have a more permanent solution.







share|improve this question

























    up vote
    0
    down vote

    favorite












    Sometimes when I run the commands:



    sudo apk update && sudo apk upgrade


    Over Alpine linux fails to update the packages even if connected to internet. But if I do sudo su "echo 'nameserver 8.8.8.8' > /etc/resolv.conf" I manage to dowload them. But this solution:



    • Causes me frustration I need to set dns all over the time.

    • Sometimes /etc/resolv.conf gets overriden by itself.

    How I can have a more permanent solution.







    share|improve this question























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      Sometimes when I run the commands:



      sudo apk update && sudo apk upgrade


      Over Alpine linux fails to update the packages even if connected to internet. But if I do sudo su "echo 'nameserver 8.8.8.8' > /etc/resolv.conf" I manage to dowload them. But this solution:



      • Causes me frustration I need to set dns all over the time.

      • Sometimes /etc/resolv.conf gets overriden by itself.

      How I can have a more permanent solution.







      share|improve this question













      Sometimes when I run the commands:



      sudo apk update && sudo apk upgrade


      Over Alpine linux fails to update the packages even if connected to internet. But if I do sudo su "echo 'nameserver 8.8.8.8' > /etc/resolv.conf" I manage to dowload them. But this solution:



      • Causes me frustration I need to set dns all over the time.

      • Sometimes /etc/resolv.conf gets overriden by itself.

      How I can have a more permanent solution.









      share|improve this question












      share|improve this question




      share|improve this question








      edited May 4 at 0:14
























      asked May 3 at 21:21









      Dimitrios Desyllas

      1599




      1599




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote



          accepted










          You can solve the problem by installing the dhclient package. For the last time enable Google's DNS servers by runing for the last time:



          sudo su "echo 'nameserver 8.8.8.8' > /etc/resolv.conf"


          Then run this cocktail of commands:



          sudo apk update && sudo apk upgrade && sudo apk add dhclient


          In order to get the fresh packages and install the dhclient. Then configure the /etc/dhcp/dhclient.conf and put the following:



          option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;

          send host-name = gethostname();
          request subnet-mask, broadcast-address, time-offset, routers,
          domain-name, domain-name-servers, domain-search, host-name,
          dhcp6.name-servers, dhcp6.domain-search, dhcp6.fqdn, dhcp6.sntp-servers,
          netbios-name-servers, netbios-scope, interface-mtu,
          rfc3442-classless-static-routes, ntp-servers;

          prepend domain-name-servers 8.8.8.8, 8.8.4.4;


          And restart the networking:



          sudo rc-service networking restart


          Optionally you can confirm that works if you run:



          sudo reboot


          In either case you can confirm that dins is resolved by pinging the google.



          ping google.com





          share|improve this answer























            Your Answer







            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "106"
            ;
            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',
            convertImagesToLinks: false,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );








             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f441664%2falpine-linux-sometimes-dns-is-not-resolved%23new-answer', 'question_page');

            );

            Post as a guest






























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            0
            down vote



            accepted










            You can solve the problem by installing the dhclient package. For the last time enable Google's DNS servers by runing for the last time:



            sudo su "echo 'nameserver 8.8.8.8' > /etc/resolv.conf"


            Then run this cocktail of commands:



            sudo apk update && sudo apk upgrade && sudo apk add dhclient


            In order to get the fresh packages and install the dhclient. Then configure the /etc/dhcp/dhclient.conf and put the following:



            option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;

            send host-name = gethostname();
            request subnet-mask, broadcast-address, time-offset, routers,
            domain-name, domain-name-servers, domain-search, host-name,
            dhcp6.name-servers, dhcp6.domain-search, dhcp6.fqdn, dhcp6.sntp-servers,
            netbios-name-servers, netbios-scope, interface-mtu,
            rfc3442-classless-static-routes, ntp-servers;

            prepend domain-name-servers 8.8.8.8, 8.8.4.4;


            And restart the networking:



            sudo rc-service networking restart


            Optionally you can confirm that works if you run:



            sudo reboot


            In either case you can confirm that dins is resolved by pinging the google.



            ping google.com





            share|improve this answer



























              up vote
              0
              down vote



              accepted










              You can solve the problem by installing the dhclient package. For the last time enable Google's DNS servers by runing for the last time:



              sudo su "echo 'nameserver 8.8.8.8' > /etc/resolv.conf"


              Then run this cocktail of commands:



              sudo apk update && sudo apk upgrade && sudo apk add dhclient


              In order to get the fresh packages and install the dhclient. Then configure the /etc/dhcp/dhclient.conf and put the following:



              option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;

              send host-name = gethostname();
              request subnet-mask, broadcast-address, time-offset, routers,
              domain-name, domain-name-servers, domain-search, host-name,
              dhcp6.name-servers, dhcp6.domain-search, dhcp6.fqdn, dhcp6.sntp-servers,
              netbios-name-servers, netbios-scope, interface-mtu,
              rfc3442-classless-static-routes, ntp-servers;

              prepend domain-name-servers 8.8.8.8, 8.8.4.4;


              And restart the networking:



              sudo rc-service networking restart


              Optionally you can confirm that works if you run:



              sudo reboot


              In either case you can confirm that dins is resolved by pinging the google.



              ping google.com





              share|improve this answer

























                up vote
                0
                down vote



                accepted







                up vote
                0
                down vote



                accepted






                You can solve the problem by installing the dhclient package. For the last time enable Google's DNS servers by runing for the last time:



                sudo su "echo 'nameserver 8.8.8.8' > /etc/resolv.conf"


                Then run this cocktail of commands:



                sudo apk update && sudo apk upgrade && sudo apk add dhclient


                In order to get the fresh packages and install the dhclient. Then configure the /etc/dhcp/dhclient.conf and put the following:



                option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;

                send host-name = gethostname();
                request subnet-mask, broadcast-address, time-offset, routers,
                domain-name, domain-name-servers, domain-search, host-name,
                dhcp6.name-servers, dhcp6.domain-search, dhcp6.fqdn, dhcp6.sntp-servers,
                netbios-name-servers, netbios-scope, interface-mtu,
                rfc3442-classless-static-routes, ntp-servers;

                prepend domain-name-servers 8.8.8.8, 8.8.4.4;


                And restart the networking:



                sudo rc-service networking restart


                Optionally you can confirm that works if you run:



                sudo reboot


                In either case you can confirm that dins is resolved by pinging the google.



                ping google.com





                share|improve this answer















                You can solve the problem by installing the dhclient package. For the last time enable Google's DNS servers by runing for the last time:



                sudo su "echo 'nameserver 8.8.8.8' > /etc/resolv.conf"


                Then run this cocktail of commands:



                sudo apk update && sudo apk upgrade && sudo apk add dhclient


                In order to get the fresh packages and install the dhclient. Then configure the /etc/dhcp/dhclient.conf and put the following:



                option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;

                send host-name = gethostname();
                request subnet-mask, broadcast-address, time-offset, routers,
                domain-name, domain-name-servers, domain-search, host-name,
                dhcp6.name-servers, dhcp6.domain-search, dhcp6.fqdn, dhcp6.sntp-servers,
                netbios-name-servers, netbios-scope, interface-mtu,
                rfc3442-classless-static-routes, ntp-servers;

                prepend domain-name-servers 8.8.8.8, 8.8.4.4;


                And restart the networking:



                sudo rc-service networking restart


                Optionally you can confirm that works if you run:



                sudo reboot


                In either case you can confirm that dins is resolved by pinging the google.



                ping google.com






                share|improve this answer















                share|improve this answer



                share|improve this answer








                edited May 5 at 16:47


























                answered May 3 at 21:21









                Dimitrios Desyllas

                1599




                1599






















                     

                    draft saved


                    draft discarded


























                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f441664%2falpine-linux-sometimes-dns-is-not-resolved%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Popular posts from this blog

                    Peggy Mitchell

                    Palaiologos

                    The Forum (Inglewood, California)