Skip to content

Instantly share code, notes, and snippets.

@darth-veitcher
Created May 5, 2022 07:38
Show Gist options
  • Save darth-veitcher/215d972491cbaebab4d9182c9ace4bd7 to your computer and use it in GitHub Desktop.
Save darth-veitcher/215d972491cbaebab4d9182c9ace4bd7 to your computer and use it in GitHub Desktop.
Get current IP from google.com
dig -4 TXT +short o-o.myaddr.l.google.com @ns1.google.com | awk -F'\"' '{ print $2}'
@darth-veitcher
Copy link
Author

Combine with Zone DNS Updates for Cloudflare:

curl -X PUT "https://api.cloudflare.com/client/v4/zones/023e105f4ecef8ad9ca31a8372d0c353/dns_records/372e67954025e0ba6aaa6d586b9e0b59" \
     -H "X-Auth-Email: [email protected]" \
     -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41" \
     -H "Content-Type: application/json" \
     --data '{"type":"A","name":"example.com","content":"127.0.0.1","ttl":3600,"proxied":false}'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment