1
0
mirror of https://github.com/tiyn/wiki.git synced 2025-04-04 07:47:45 +02:00

ip: get outside ip now correct

This commit is contained in:
tiyn 2023-02-16 03:22:37 +01:00
parent 9770e7bec2
commit faf80e2ab4

View File

@ -39,3 +39,9 @@ package - like in Ubuntu - or even another package depending on the distribution
used. used.
After installation the following command can be used to get the outside IP After installation the following command can be used to get the outside IP
address of your system `dig +short txt ch whoami.cloudflare @1.0.0.1`. address of your system `dig +short txt ch whoami.cloudflare @1.0.0.1`.
There is an alternative to this using `wget`.
It uses a call to Google and requests the outside IP from there.
Due to using Google there might be problems with privacy.
The mentioned command is the following
`wget -U Mozilla/5.0 -qqO- 'https://www.google.com/search?q=what+is+my+ip' | grep -Po '>\K[0-9.]{7,}(?=<.{0,99}>Your public IP)'`.