What's new

VPNMON VPNMON-R3 Custom Server List Generation Tutorials and Examples

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

I have not tried Unbound via NordVPN yet so what exactly is not working when it comes to Unbound via NordVPN ? Top level DNS servers are not accesible via NordVPN ?
Like something is getting blocked when using Unbound over NordVPN. They have acknowledged the issue. No resolution in sight. It still works great on AirVPN.
 
Here is the code for ProtonVPN servers If anyone wants it. Haven't tested it yet.
Code:
curl --silent --retry 3 --connect-timeout 3 --max-time 6 --retry-delay 1 --retry-all-errors https://api.protonvpn.ch/vpn/logicals | jq --raw-output '.LogicalServers[] | select(.Name | contains("US")) | .Servers[].ExitIP'

replace the contains("US") with the country prefix of your choice.
 
Here is the code for ProtonVPN servers If anyone wants it. Haven't tested it yet.
Code:
curl --silent --retry 3 --connect-timeout 3 --max-time 6 --retry-delay 1 --retry-all-errors https://api.protonvpn.ch/vpn/logicals | jq --raw-output '.LogicalServers[] | select(.Name | contains("US")) | .Servers[].ExitIP'

replace the contains("US") with the country prefix of your choice.
Nice job! Looks like it does the trick! I'll add this to the OP instructions!
 
Nice job! Looks like it does the trick! I'll add this to the OP instructions!
I just tested the previous command and it didn't work I had to replace the .ExitIP with .EntryIP to make it connect.

However I ran into an issue where it returns multiple entries for each ip please run this curl and tell me what you think of the result. One thing I think we should take into account is the port number since the api doesn't list any port numbers for the servers.

Code:
curl --silent --retry 3 --connect-timeout 3 --max-time 6 --retry-delay 1 --retry-all-errors https://api.protonvpn.ch/vpn/logicals | jq --raw-output '.LogicalServers[] | select(.Name | contains("DE")) | .Servers[].EntryIP'
 
I just tested the previous command and it didn't work I had to replace the .ExitIP with .EntryIP to make it connect.

However I ran into an issue where it returns multiple entries for each ip please run this curl and tell me what you think of the result. One thing I think we should take into account is the port number since the api doesn't list any port numbers for the servers.

Code:
curl --silent --retry 3 --connect-timeout 3 --max-time 6 --retry-delay 1 --retry-all-errors https://api.protonvpn.ch/vpn/logicals | jq --raw-output '.LogicalServers[] | select(.Name | contains("DE")) | .Servers[].EntryIP'
Good call. Typically the port would be the same across the board... you would receive that information when you download your server cert and import that into the VPN Client Slot section.

By a complete stroke of luck, I've had success dumping out the entire list of cities and countries in a sorted list as well! :)

All possible City Names:
Code:
curl --silent --retry 3 --connect-timeout 3 --max-time 6 --retry-delay 1 --retry-all-errors https://api.protonvpn.ch/vpn/logicals | jq --raw-output '.LogicalServers | group_by(.City) | map(.[0].City)'

All possible Country codes:
Code:
curl --silent --retry 3 --connect-timeout 3 --max-time 6 --retry-delay 1 --retry-all-errors https://api.protonvpn.ch/vpn/logicals | jq --raw-output '.LogicalServers | group_by(.EntryCountry) | map(.[0].EntryCountry)'
 
Awesome Job!!

here is the command to which filters duplicate entries by adding | sort | uniq at the end.

Code:
curl --silent --retry 3 --connect-timeout 3 --max-time 6 --retry-delay 1 --retry-all-errors https://api.protonvpn.ch/vpn/logicals | jq --raw-output '.LogicalServers[] | select(.EntryCountry | contains("DE")) | .Servers[].EntryIP' | sort | uniq
 
Awesome Job!!
Same to you, @Rajjco! I've added your instructions here under the main OP! Thanks again! :)

 
Here’s so info I got about Private Internet Access (PIA)…. In case anyone who’s better at this than me wants to rewrite this as a useable CURL + JQ statement for PIA servers. 🫠🙏🙏
curl https://serverlist.piaservers.net/vpninfo/servers/v6

Do note that the result is 1-line JSON with some sort of digital signature appended, so jq or similar will pop a warning but otherwise should work fine - or you can just feed it through head -n1 if you don't like the warning.

My pia-wg script [https://github.com/triffid/pia-wg/blob/master/pia-wg.sh] may offer some hints on parsing this file in case it helps.
 
Here’s so info I got about Private Internet Access (PIA)…. In case anyone who’s better at this than me wants to rewrite this as a useable CURL + JQ statement for PIA servers. 🫠🙏🙏
I think I may have something here!!

This provides a list of country codes... I'm going to be using "US":
Code:
curl --silent --retry 3 --connect-timeout 3 --max-time 6 --retry-delay 1 --retry-all-errors https://serverlist.piaservers.net/vpninfo/servers/v6 | jq --raw-output '.regions[] | .country' | sort | uniq 2>/dev/null

This query extracts all OVPN UDP servers for the US:
Code:
curl --silent --retry 3 --connect-timeout 3 --max-time 6 --retry-delay 1 --retry-all-errors https://serverlist.piaservers.net/vpninfo/servers/v6 | jq --raw-output '.regions[] | select(.country=="US") | .servers.ovpnudp[].ip' | sort | uniq 2>/dev/null

But even though it comes back with what seems like a legit list of IPs, I can't seem to match any of the output back to the original https://serverlist.piaservers.net/vpninfo/servers/v6 list... where am going wrong? 🤬

EDIT: OK... when you refresh the URL, all IPs keep changing. WTH? So that's why. I would be interesting to see if an IP that was queried from an hour ago would still work.

This provides a list of all US-based cities and states mixed (if you want to narrow down where you connect to - again, using your country code):

Code:
curl --silent --retry 3 --connect-timeout 3 --max-time 6 --retry-delay 1 --retry-all-errors https://serverlist.piaservers.net/vpninfo/servers/v6 | jq --raw-output '.regions[] | select(.country=="US") | .name' | sort | uniq 2>/dev/null

So if you just want to connect to all servers in the "US New York" area, you would use:
Code:
curl --silent --retry 3 --connect-timeout 3 --max-time 6 --retry-delay 1 --retry-all-errors https://serverlist.piaservers.net/vpninfo/servers/v6 | jq --raw-output '.regions[] | select(.name=="US New York") | .servers.ovpnudp[].ip' 2>/dev/null

And for some reason, this API extract contains some sort of key on the bottom that messes with the JQ output, and produces this error message after it extracts all the IP addresses... need to figure out how to eliminate this. :(

jq: parse error: Invalid numeric literal at line 4, column 0

EDIT: and that's fixed by putting a "2>/dev/null" on the end of the curl statement! Whoo! Looks like PIA is getting added to the list! :)
 
Last edited:
@JTnola ... please confirm this all works OK for you once integrated into VPNMON-R3? Once I have your blessing, I'll get it added to the OP! :) Thanks for sharing... you got me down a rabbit hole, but I think this is going to work!
 

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top