Is there a way to resolve ALL PIA VPN IPs with a script?

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












2















I am looking for a way to get a complete list of all the current IP addresses for PrivateInternetAccess' servers. I need the complete list so that I can manually enter them into a killswitch for OpenVPN. I am using Adrelanos VPN Firewall for a killswitch as described here:




VPN (OpenVPN) Firewall Killswitch For Linux Users



I saw on PIA's forums that someone had asked for a list here: List of Server IPs

but since services started blocking the IPs, the only way to get them is through the hostnames. This would be extremely time consuming for me to do.



I want to know if there is perhaps a simple script that can ping the servers enough times to sort through the IPs and organize them. Any other method would be fantastic as well. It would be easy if each hostname only had one server and IP, but as of now, the Netherlands hostname alone has 278 servers. I can't spend my time pinging the server over and over again, cross out redundant IPs, then count to make sure I have all 278. I don't want just the Netherlands IP addresses either. I would prefer a method as simple as entering the hostnames in and getting results. Any advice would be great. Thanks!










share|improve this question




























    2















    I am looking for a way to get a complete list of all the current IP addresses for PrivateInternetAccess' servers. I need the complete list so that I can manually enter them into a killswitch for OpenVPN. I am using Adrelanos VPN Firewall for a killswitch as described here:




    VPN (OpenVPN) Firewall Killswitch For Linux Users



    I saw on PIA's forums that someone had asked for a list here: List of Server IPs

    but since services started blocking the IPs, the only way to get them is through the hostnames. This would be extremely time consuming for me to do.



    I want to know if there is perhaps a simple script that can ping the servers enough times to sort through the IPs and organize them. Any other method would be fantastic as well. It would be easy if each hostname only had one server and IP, but as of now, the Netherlands hostname alone has 278 servers. I can't spend my time pinging the server over and over again, cross out redundant IPs, then count to make sure I have all 278. I don't want just the Netherlands IP addresses either. I would prefer a method as simple as entering the hostnames in and getting results. Any advice would be great. Thanks!










    share|improve this question


























      2












      2








      2


      1






      I am looking for a way to get a complete list of all the current IP addresses for PrivateInternetAccess' servers. I need the complete list so that I can manually enter them into a killswitch for OpenVPN. I am using Adrelanos VPN Firewall for a killswitch as described here:




      VPN (OpenVPN) Firewall Killswitch For Linux Users



      I saw on PIA's forums that someone had asked for a list here: List of Server IPs

      but since services started blocking the IPs, the only way to get them is through the hostnames. This would be extremely time consuming for me to do.



      I want to know if there is perhaps a simple script that can ping the servers enough times to sort through the IPs and organize them. Any other method would be fantastic as well. It would be easy if each hostname only had one server and IP, but as of now, the Netherlands hostname alone has 278 servers. I can't spend my time pinging the server over and over again, cross out redundant IPs, then count to make sure I have all 278. I don't want just the Netherlands IP addresses either. I would prefer a method as simple as entering the hostnames in and getting results. Any advice would be great. Thanks!










      share|improve this question
















      I am looking for a way to get a complete list of all the current IP addresses for PrivateInternetAccess' servers. I need the complete list so that I can manually enter them into a killswitch for OpenVPN. I am using Adrelanos VPN Firewall for a killswitch as described here:




      VPN (OpenVPN) Firewall Killswitch For Linux Users



      I saw on PIA's forums that someone had asked for a list here: List of Server IPs

      but since services started blocking the IPs, the only way to get them is through the hostnames. This would be extremely time consuming for me to do.



      I want to know if there is perhaps a simple script that can ping the servers enough times to sort through the IPs and organize them. Any other method would be fantastic as well. It would be easy if each hostname only had one server and IP, but as of now, the Netherlands hostname alone has 278 servers. I can't spend my time pinging the server over and over again, cross out redundant IPs, then count to make sure I have all 278. I don't want just the Netherlands IP addresses either. I would prefer a method as simple as entering the hostnames in and getting results. Any advice would be great. Thanks!







      linux shell-script security vpn openvpn






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 11 '16 at 21:30









      tink

      4,48911221




      4,48911221










      asked Mar 11 '16 at 20:39









      Jsmith93Jsmith93

      113




      113




















          2 Answers
          2






          active

          oldest

          votes


















          2














          I think this does what you're asking. Whipped up in 3 minutes.



          wget -q https://www.privateinternetaccess.com/pages/network/ -O - | grep -E -o '>[^.]+.privateinternetaccess.com<' | tr -d '[<>]' | while read host ;do host $host ;done | awk 'print $NF' | sort -u > ip_list


          So we fetch the webpage with all the hostnames with wget and output it to STDOUT while suppressing activity reports from wget.



          wget -q https://www.privateinternetaccess.com/pages/network/ -O -


          We grep for the host names in the output.



          grep -E -o '>[^.]+.privateinternetaccess.com<'


          Then use tr to strip the angle-backets from the host names.



          tr -d '[<>]'


          We then loop over the host names with a bash while-loop, and resolve them.



          while read host ;do host $host ;done


          The advantage of using host over pinging the name is that you will get them all, without getting duplicates.



          The output of the name resolution gets cleaned up with awk, and then sorted uniquely, not that I think there would be duplicates, and write the results to the file ip_list.



          awk 'print $NF' | sort -u > ip_list


          In case you wonder what the awk does: it prints the last field of each line.






          share|improve this answer

























          • Thank you! I just have one more question. The output file "ip_list" only came back with 433 results. I am not sure if that means that all of the servers combined only have 433 IP addresses in total or it just didn't resolve all of them. Is it safe to assume that multiple servers have the same IP address?

            – Jsmith93
            Mar 11 '16 at 22:31











          • @Jsmith93: that's an excellent question that I don't have the time to answer :) ... feel free to play with the command-line and disect individual steps, verify that what each outputs matches your expectations/compare counts (add random wc - l statements in disecting)...

            – tink
            Mar 11 '16 at 22:35











          • @Jsmith93: I just checked a few lines, and e.g. USA California claims on the website they have 220 servers, but they only return 13 IP ... so, I'll trust DNS more than their website statements ;}

            – tink
            Mar 11 '16 at 22:39











          • Thanks! I will comment if I run into another error later on. Have a good day!

            – Jsmith93
            Mar 11 '16 at 22:41






          • 1





            Nice solution! Just ran it from ATT Uverse in West Palm Beach and got back 466 IP addresses. It's indeed possible that different locations/networks will yield different results if PIA is using geo-distributed DNS. They may indeed want to route traffic via certain routes depending on where you're coming from.

            – ericWasTaken
            Aug 28 '17 at 13:55


















          0














          You can try this Bash script
          Select Fastest PIA Server



          The program netselect is required.



          It selects the fastest server from the country of choice



          Then selects the fastest IP address to that server.






          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',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            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%2funix.stackexchange.com%2fquestions%2f269245%2fis-there-a-way-to-resolve-all-pia-vpn-ips-with-a-script%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









            2














            I think this does what you're asking. Whipped up in 3 minutes.



            wget -q https://www.privateinternetaccess.com/pages/network/ -O - | grep -E -o '>[^.]+.privateinternetaccess.com<' | tr -d '[<>]' | while read host ;do host $host ;done | awk 'print $NF' | sort -u > ip_list


            So we fetch the webpage with all the hostnames with wget and output it to STDOUT while suppressing activity reports from wget.



            wget -q https://www.privateinternetaccess.com/pages/network/ -O -


            We grep for the host names in the output.



            grep -E -o '>[^.]+.privateinternetaccess.com<'


            Then use tr to strip the angle-backets from the host names.



            tr -d '[<>]'


            We then loop over the host names with a bash while-loop, and resolve them.



            while read host ;do host $host ;done


            The advantage of using host over pinging the name is that you will get them all, without getting duplicates.



            The output of the name resolution gets cleaned up with awk, and then sorted uniquely, not that I think there would be duplicates, and write the results to the file ip_list.



            awk 'print $NF' | sort -u > ip_list


            In case you wonder what the awk does: it prints the last field of each line.






            share|improve this answer

























            • Thank you! I just have one more question. The output file "ip_list" only came back with 433 results. I am not sure if that means that all of the servers combined only have 433 IP addresses in total or it just didn't resolve all of them. Is it safe to assume that multiple servers have the same IP address?

              – Jsmith93
              Mar 11 '16 at 22:31











            • @Jsmith93: that's an excellent question that I don't have the time to answer :) ... feel free to play with the command-line and disect individual steps, verify that what each outputs matches your expectations/compare counts (add random wc - l statements in disecting)...

              – tink
              Mar 11 '16 at 22:35











            • @Jsmith93: I just checked a few lines, and e.g. USA California claims on the website they have 220 servers, but they only return 13 IP ... so, I'll trust DNS more than their website statements ;}

              – tink
              Mar 11 '16 at 22:39











            • Thanks! I will comment if I run into another error later on. Have a good day!

              – Jsmith93
              Mar 11 '16 at 22:41






            • 1





              Nice solution! Just ran it from ATT Uverse in West Palm Beach and got back 466 IP addresses. It's indeed possible that different locations/networks will yield different results if PIA is using geo-distributed DNS. They may indeed want to route traffic via certain routes depending on where you're coming from.

              – ericWasTaken
              Aug 28 '17 at 13:55















            2














            I think this does what you're asking. Whipped up in 3 minutes.



            wget -q https://www.privateinternetaccess.com/pages/network/ -O - | grep -E -o '>[^.]+.privateinternetaccess.com<' | tr -d '[<>]' | while read host ;do host $host ;done | awk 'print $NF' | sort -u > ip_list


            So we fetch the webpage with all the hostnames with wget and output it to STDOUT while suppressing activity reports from wget.



            wget -q https://www.privateinternetaccess.com/pages/network/ -O -


            We grep for the host names in the output.



            grep -E -o '>[^.]+.privateinternetaccess.com<'


            Then use tr to strip the angle-backets from the host names.



            tr -d '[<>]'


            We then loop over the host names with a bash while-loop, and resolve them.



            while read host ;do host $host ;done


            The advantage of using host over pinging the name is that you will get them all, without getting duplicates.



            The output of the name resolution gets cleaned up with awk, and then sorted uniquely, not that I think there would be duplicates, and write the results to the file ip_list.



            awk 'print $NF' | sort -u > ip_list


            In case you wonder what the awk does: it prints the last field of each line.






            share|improve this answer

























            • Thank you! I just have one more question. The output file "ip_list" only came back with 433 results. I am not sure if that means that all of the servers combined only have 433 IP addresses in total or it just didn't resolve all of them. Is it safe to assume that multiple servers have the same IP address?

              – Jsmith93
              Mar 11 '16 at 22:31











            • @Jsmith93: that's an excellent question that I don't have the time to answer :) ... feel free to play with the command-line and disect individual steps, verify that what each outputs matches your expectations/compare counts (add random wc - l statements in disecting)...

              – tink
              Mar 11 '16 at 22:35











            • @Jsmith93: I just checked a few lines, and e.g. USA California claims on the website they have 220 servers, but they only return 13 IP ... so, I'll trust DNS more than their website statements ;}

              – tink
              Mar 11 '16 at 22:39











            • Thanks! I will comment if I run into another error later on. Have a good day!

              – Jsmith93
              Mar 11 '16 at 22:41






            • 1





              Nice solution! Just ran it from ATT Uverse in West Palm Beach and got back 466 IP addresses. It's indeed possible that different locations/networks will yield different results if PIA is using geo-distributed DNS. They may indeed want to route traffic via certain routes depending on where you're coming from.

              – ericWasTaken
              Aug 28 '17 at 13:55













            2












            2








            2







            I think this does what you're asking. Whipped up in 3 minutes.



            wget -q https://www.privateinternetaccess.com/pages/network/ -O - | grep -E -o '>[^.]+.privateinternetaccess.com<' | tr -d '[<>]' | while read host ;do host $host ;done | awk 'print $NF' | sort -u > ip_list


            So we fetch the webpage with all the hostnames with wget and output it to STDOUT while suppressing activity reports from wget.



            wget -q https://www.privateinternetaccess.com/pages/network/ -O -


            We grep for the host names in the output.



            grep -E -o '>[^.]+.privateinternetaccess.com<'


            Then use tr to strip the angle-backets from the host names.



            tr -d '[<>]'


            We then loop over the host names with a bash while-loop, and resolve them.



            while read host ;do host $host ;done


            The advantage of using host over pinging the name is that you will get them all, without getting duplicates.



            The output of the name resolution gets cleaned up with awk, and then sorted uniquely, not that I think there would be duplicates, and write the results to the file ip_list.



            awk 'print $NF' | sort -u > ip_list


            In case you wonder what the awk does: it prints the last field of each line.






            share|improve this answer















            I think this does what you're asking. Whipped up in 3 minutes.



            wget -q https://www.privateinternetaccess.com/pages/network/ -O - | grep -E -o '>[^.]+.privateinternetaccess.com<' | tr -d '[<>]' | while read host ;do host $host ;done | awk 'print $NF' | sort -u > ip_list


            So we fetch the webpage with all the hostnames with wget and output it to STDOUT while suppressing activity reports from wget.



            wget -q https://www.privateinternetaccess.com/pages/network/ -O -


            We grep for the host names in the output.



            grep -E -o '>[^.]+.privateinternetaccess.com<'


            Then use tr to strip the angle-backets from the host names.



            tr -d '[<>]'


            We then loop over the host names with a bash while-loop, and resolve them.



            while read host ;do host $host ;done


            The advantage of using host over pinging the name is that you will get them all, without getting duplicates.



            The output of the name resolution gets cleaned up with awk, and then sorted uniquely, not that I think there would be duplicates, and write the results to the file ip_list.



            awk 'print $NF' | sort -u > ip_list


            In case you wonder what the awk does: it prints the last field of each line.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Mar 11 '16 at 22:33

























            answered Mar 11 '16 at 21:11









            tinktink

            4,48911221




            4,48911221












            • Thank you! I just have one more question. The output file "ip_list" only came back with 433 results. I am not sure if that means that all of the servers combined only have 433 IP addresses in total or it just didn't resolve all of them. Is it safe to assume that multiple servers have the same IP address?

              – Jsmith93
              Mar 11 '16 at 22:31











            • @Jsmith93: that's an excellent question that I don't have the time to answer :) ... feel free to play with the command-line and disect individual steps, verify that what each outputs matches your expectations/compare counts (add random wc - l statements in disecting)...

              – tink
              Mar 11 '16 at 22:35











            • @Jsmith93: I just checked a few lines, and e.g. USA California claims on the website they have 220 servers, but they only return 13 IP ... so, I'll trust DNS more than their website statements ;}

              – tink
              Mar 11 '16 at 22:39











            • Thanks! I will comment if I run into another error later on. Have a good day!

              – Jsmith93
              Mar 11 '16 at 22:41






            • 1





              Nice solution! Just ran it from ATT Uverse in West Palm Beach and got back 466 IP addresses. It's indeed possible that different locations/networks will yield different results if PIA is using geo-distributed DNS. They may indeed want to route traffic via certain routes depending on where you're coming from.

              – ericWasTaken
              Aug 28 '17 at 13:55

















            • Thank you! I just have one more question. The output file "ip_list" only came back with 433 results. I am not sure if that means that all of the servers combined only have 433 IP addresses in total or it just didn't resolve all of them. Is it safe to assume that multiple servers have the same IP address?

              – Jsmith93
              Mar 11 '16 at 22:31











            • @Jsmith93: that's an excellent question that I don't have the time to answer :) ... feel free to play with the command-line and disect individual steps, verify that what each outputs matches your expectations/compare counts (add random wc - l statements in disecting)...

              – tink
              Mar 11 '16 at 22:35











            • @Jsmith93: I just checked a few lines, and e.g. USA California claims on the website they have 220 servers, but they only return 13 IP ... so, I'll trust DNS more than their website statements ;}

              – tink
              Mar 11 '16 at 22:39











            • Thanks! I will comment if I run into another error later on. Have a good day!

              – Jsmith93
              Mar 11 '16 at 22:41






            • 1





              Nice solution! Just ran it from ATT Uverse in West Palm Beach and got back 466 IP addresses. It's indeed possible that different locations/networks will yield different results if PIA is using geo-distributed DNS. They may indeed want to route traffic via certain routes depending on where you're coming from.

              – ericWasTaken
              Aug 28 '17 at 13:55
















            Thank you! I just have one more question. The output file "ip_list" only came back with 433 results. I am not sure if that means that all of the servers combined only have 433 IP addresses in total or it just didn't resolve all of them. Is it safe to assume that multiple servers have the same IP address?

            – Jsmith93
            Mar 11 '16 at 22:31





            Thank you! I just have one more question. The output file "ip_list" only came back with 433 results. I am not sure if that means that all of the servers combined only have 433 IP addresses in total or it just didn't resolve all of them. Is it safe to assume that multiple servers have the same IP address?

            – Jsmith93
            Mar 11 '16 at 22:31













            @Jsmith93: that's an excellent question that I don't have the time to answer :) ... feel free to play with the command-line and disect individual steps, verify that what each outputs matches your expectations/compare counts (add random wc - l statements in disecting)...

            – tink
            Mar 11 '16 at 22:35





            @Jsmith93: that's an excellent question that I don't have the time to answer :) ... feel free to play with the command-line and disect individual steps, verify that what each outputs matches your expectations/compare counts (add random wc - l statements in disecting)...

            – tink
            Mar 11 '16 at 22:35













            @Jsmith93: I just checked a few lines, and e.g. USA California claims on the website they have 220 servers, but they only return 13 IP ... so, I'll trust DNS more than their website statements ;}

            – tink
            Mar 11 '16 at 22:39





            @Jsmith93: I just checked a few lines, and e.g. USA California claims on the website they have 220 servers, but they only return 13 IP ... so, I'll trust DNS more than their website statements ;}

            – tink
            Mar 11 '16 at 22:39













            Thanks! I will comment if I run into another error later on. Have a good day!

            – Jsmith93
            Mar 11 '16 at 22:41





            Thanks! I will comment if I run into another error later on. Have a good day!

            – Jsmith93
            Mar 11 '16 at 22:41




            1




            1





            Nice solution! Just ran it from ATT Uverse in West Palm Beach and got back 466 IP addresses. It's indeed possible that different locations/networks will yield different results if PIA is using geo-distributed DNS. They may indeed want to route traffic via certain routes depending on where you're coming from.

            – ericWasTaken
            Aug 28 '17 at 13:55





            Nice solution! Just ran it from ATT Uverse in West Palm Beach and got back 466 IP addresses. It's indeed possible that different locations/networks will yield different results if PIA is using geo-distributed DNS. They may indeed want to route traffic via certain routes depending on where you're coming from.

            – ericWasTaken
            Aug 28 '17 at 13:55













            0














            You can try this Bash script
            Select Fastest PIA Server



            The program netselect is required.



            It selects the fastest server from the country of choice



            Then selects the fastest IP address to that server.






            share|improve this answer



























              0














              You can try this Bash script
              Select Fastest PIA Server



              The program netselect is required.



              It selects the fastest server from the country of choice



              Then selects the fastest IP address to that server.






              share|improve this answer

























                0












                0








                0







                You can try this Bash script
                Select Fastest PIA Server



                The program netselect is required.



                It selects the fastest server from the country of choice



                Then selects the fastest IP address to that server.






                share|improve this answer













                You can try this Bash script
                Select Fastest PIA Server



                The program netselect is required.



                It selects the fastest server from the country of choice



                Then selects the fastest IP address to that server.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Feb 2 at 7:58









                FrankLFrankL

                1




                1



























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Unix & Linux Stack Exchange!


                    • 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%2funix.stackexchange.com%2fquestions%2f269245%2fis-there-a-way-to-resolve-all-pia-vpn-ips-with-a-script%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 to check contact read email or not when send email to Individual?

                    Displaying single band from multi-band raster using QGIS

                    How many registers does an x86_64 CPU actually have?