How do I use the Linode API to set my Reverse DNS (rDNS)?
hphillips
Linode Staff
I recently obtained a pool of IPv6 addresses and I would like to automate the assignment of rDNS to addresses in this pool. How do I do this?
1 Reply
hphillips
Linode Staff
In order to assign rDNS for an IP address, you must make sure that the name you intend to use resolves to the IP address.
Getting Familiar with v4 of the Linode API
You can review the following guide:
Once you have an access token as described in the above guide you can then get the information needed to build your request to set reverse DNS. Documentation can be found here
Using the API to set the rDNS of your IPv6 address
You will need to replace three pieces of information in the example below:
- $IPV6_ADDRESS
- $DNS_NAME
- $TOKEN (Your Access Token having read_write access to ips)
curl -H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN \
-X PUT -d '{
"rdns": "$DNS_NAME"
}' \
https://api.linode.com/v4/networking/ips/$IPV6_ADDRESS