Giter Site home page Giter Site logo

Comments (6)

Misioslav avatar Misioslav commented on September 18, 2024

The problem here is that ExpressVPN only uses for now IPv4 as far as I know. So it's the only option really. So in order to check if the IPs are different I can for now base it on IPv4, unless I missed the point.

from expressvpn.

benblazak avatar benblazak commented on September 18, 2024

I believe that's true. The issue is that getent seems to grab the IPv6 address if one is listed for the DDNS domain (unrelated to the ExpressVPN IP). Didn't track down how to fix that.

from expressvpn.

Misioslav avatar Misioslav commented on September 18, 2024

I didn’t check it yet but in such case using getent ahostsv4 DOMAIN might be better instead of using hosts option

from expressvpn.

benblazak avatar benblazak commented on September 18, 2024

ahh, you might be right.

worth noting, for me, any of these commands return multiple addresses (with an inconsistent order), and ahostsv4 returns multiple lines per address.

also, i just learned cloudflare has the option to proxy traffic to DDNS hosts, which has various benefits, but also breaks this script (lol).

starting to wonder if there's not a better solution all together. perhaps a script on the host or in a separate container that gets the host IP via curl api.ipify.org or similar, and writes it to a file, which the expressvpn container can bind mount.

not gonna debug this anymore myself though. just realized my expressvpn subscription is expiring soon. your changes for the other issue were super helpful, and will be enough for me till then. thanks!

from expressvpn.

Misioslav avatar Misioslav commented on September 18, 2024

If you are willing still to check then maybe the command like this would be better

dig DOMAIN +short A

it should return just ip, but if there are multiple ip we can add at the end | head -1 but still I can't guarantee the order of IPs it will return. Usually, for DDNS scenario it should have just one IP.

Or with dig we can also check any other record of the domain so your IP could be then hidden in text field or something and then we can extract it from there. Less ideal but still doable solution:

dig DOMAIN +short TXT

but then from the updating it perspective I have no idea at this moment how to do so.

EDIT: On the other hand if the issue is with how many IPs is returned, the question is why there is more than one and they are different, I think in normal scenario it should return just one IP (or multiple but the same addresses) cause it should be used just for DDNS, or am I mistaken?

If the above is correct then using getent ahostsv4 DOMAIN | head -1 | awk '{ print $1 }' OR getent ahostsv4 DOMAIN | grep "STREAM" | awk '{ print $1 }' will be better so no extra packages are needed.

from expressvpn.

benblazak avatar benblazak commented on September 18, 2024

hmm

dig DOMAIN +short A

also shows both IPv4 addresses -- but you're right, that's probably not something to worry about, since there's nothing that can be done about it here. if i turn off cloudflare's proxy setting for my DDNS domain (which i would have to do anyway, for the script to work), only one entry is returned.

i agree about the second command, no need to install extra things, and that should solve the IPv6 problem :)

worth noting that, if there are two IPv4 entries, grepping for STREAM will return two lines -- so the behavior of the two getent commands will be slightly different in this case -- but either way the script won't be doing what it's supposed to -- so it really is on the person setting things up to make sure that queries aren't returning multiple entries. i suppose you could test for this, and issue a warning... only if you think it's a problem people besides me will run into though :)

from expressvpn.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.