fix: improve DNS resolution in firewall script to filter CNAME records

This commit is contained in:
Uragami Taichi
2025-08-16 06:38:34 +09:00
parent fc8c10995f
commit eb48d5e4a8

View File

@@ -71,7 +71,7 @@ for domain in \
"statsig.anthropic.com" \
"statsig.com"; do
echo "Resolving $domain..."
ips=$(dig +short A "$domain")
ips=$(dig +noall +answer A "$domain" | awk '$4 == "A" {print $5}')
if [ -z "$ips" ]; then
echo "ERROR: Failed to resolve $domain"
exit 1