How to move domains from iwantmyname to porkbun
I had been hosting this domain on iwantmyname.com for over 9 years. It's a great registrar, but I've found a cheaper one with more features at porkbun.com. I had a bunch of records for CNAMEs and also verification subdomains for various external services. I've written a bit of shell script to use the porkbun API (documented at https://porkbun.com/api/json/v3/documentation) to create the new records.
First create an API key in porkbun's control panel. Then copy the api key and the secret to the command below.
DOMAIN="my-domain-name.example.com"
OLDIFS=${IFS}
while IFS= read -r line; do
IFS=${OLDIFS}
while read -r record type addr; do
printf 'line: record: %s type: %s addr: %s \n' "${record}" "${type}" "${addr}"
curl -H "Content-Type: application/json" --request POST --data '
{
"secretapikey": "xxxxxxxxxxxxxxxxxxxxx",
"apikey": "xxxxxxxxxxxxxxxxxx",
"name": "'"${record}"'",
"type": "'"${type}"'",
"content": "'"${addr}"'",
"ttl": "600"
}
' \
https://porkbun.com/api/json/v3/dns/create/${DOMAIN}
done <<< "${line}"
done < records.txt
My previous registrar iwantmyname doesn't have a good API (only a basic DDNS functionality), so I've copied the existing records from the web UI and massaged them with some vim macros into something like this in records.txt:
subdomain A ip.add.re.ss
subdomain CNAME othersubdomain
Then I ran the script above on the existing records, et voilà, the records are moved from old registrar to the new one.
Yorumlar