Created
July 30, 2023 23:57
Porkbun DNS Record Update Script for my Synology Router
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
API_KEY=PORKBUNAPIKEYHERE | |
API_SECRET=PORKBUNAPISECRETHERE | |
IP4_ADDR=$(ip -4 addr show eth0 | grep -oE '([0-9]{1,3}\.){3}([0-9]{1,3})') | |
IP6_ADDR=$(ip -6 addr show eth0 | grep -oE '([0-9a-f]{1,4}\:){7}([0-9a-f]{1,4})') | |
curl --header "Content-Type: application/json" \ | |
--request POST \ | |
--data '{ | |
"apikey" : "'"$API_KEY"'", | |
"secretapikey" : "'"$API_SECRET"'", | |
"content" : "'"$IP4_ADDR"'", | |
"ttl" : "600" | |
}' \ | |
https://porkbun.com/api/json/v3/dns/editByNameType/your.domain/A | |
curl --header "Content-Type: application/json" \ | |
--request POST \ | |
--data '{ | |
"apikey" : "'"$API_KEY"'", | |
"secretapikey" : "'"$API_SECRET"'", | |
"content" : "'"$IP6_ADDR"'", | |
"ttl" : "600" | |
}' \ | |
https://porkbun.com/api/json/v3/dns/editByNameType/your.domain/AAAA |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment