Go to file
Brett a3c4c50721 Update 'README.md' 2023-03-16 14:02:56 -04:00
LICENSE Initial commit 2023-03-16 13:49:07 -04:00
README.md Update 'README.md' 2023-03-16 14:02:56 -04:00
dns_fetch.py Upload files to '' 2023-03-16 13:53:27 -04:00

README.md

Scripts

General useful scripts (mostly for Linux)

dns_fetch.py

This lovely python script allows you to fetch ip address form cloudflare dns records. Useful for remote servers with dynamic ips. You can define the env file "dns_resolv_env.json" as follows:

{
        "auth_key": "key here (required without --auth)",
        "zone_id": "zone id here (optional)",
        "default_name": "website name here (optional)"
}

The script has many useful featues:

  • python3 dns_fetch.py -a -n -i
    • Returns only the ip address of the A record corresponding to default_name.
      • This can be used in bash commands: ssh username@$(python3 dns_fetch.py -a -n -i)
  • python3 dns_fetch.py -a
    • Returns all A records
  • python3 dns_fetch.py -c
    • Returns all CNAME records
  • python3 dns_fetch.py
    • Prints the raw json from cloudflare
  • python3 dns_fetch.py -n
    • Prints all records corresponding to default_name