Use IPv4 for public IP detection
This commit is contained in:
committed by
GitHub
parent
a66b0da734
commit
5828fd836c
+1
-1
@@ -58,7 +58,7 @@ done
|
|||||||
# --- Hostname detection (reverse DNS via Google DNS) ---
|
# --- Hostname detection (reverse DNS via Google DNS) ---
|
||||||
SERVER_NAME=${SERVER_NAME:-}
|
SERVER_NAME=${SERVER_NAME:-}
|
||||||
if [ -z "$SERVER_NAME" ]; then
|
if [ -z "$SERVER_NAME" ]; then
|
||||||
PUBIP=$(curl -s ifconfig.me || echo "")
|
PUBIP=$(curl -4 -s ifconfig.me || echo "")
|
||||||
if [ -n "$PUBIP" ]; then
|
if [ -n "$PUBIP" ]; then
|
||||||
apt-get install -y -qq dnsutils >/dev/null 2>&1 || true
|
apt-get install -y -qq dnsutils >/dev/null 2>&1 || true
|
||||||
REVNAME=$(dig +short -x $PUBIP @8.8.8.8 | sed 's/\.$//' || true)
|
REVNAME=$(dig +short -x $PUBIP @8.8.8.8 | sed 's/\.$//' || true)
|
||||||
|
|||||||
Reference in New Issue
Block a user