Is it possible to route DynamicDNS to a subdomain?

I want to route my dynamic ip to a subdomain on my domain. is this possible?
i know i would need a dynamicDNS client but where would i route it.

It depends on the client you use, but it’s not really a question for this Community.

As Matteo said, it’s possible and the Cloudflare API supports it. You’d just have to find out from the DDNS app vendor how to do so.

2 Likes

are there any clients you reccomend?

Sorry, I’ve only hand-coded my own shell scripts to do this.

#!/bin/csh
set ipadr = `ipconfig getifaddr en1`
curl -X PUT "https://api.cloudflare.com/client/v4/zones/ZONE_ID/dns_records/RECORD_ID" \
     -H "X-Auth-Email: [email protected]" \
     -H "X-Auth-Key: GLOBAL_API_KEY" \
     -H "Content-Type: application/json" \
     --data '{"type":"A","name":"sub.example.com","content":"'${ipadr}'","ttl":1,"proxied":false}'
echo ""
1 Like

You should really use an API Token, now, though. :slight_smile:

1 Like

That script was from many years ago.

2 Likes

I know you know that, but for posterity’s sake… :slight_smile:

2 Likes

Ill have to look into this, i have a local linux server and will probably make a service to update the ipaddr. ty for your help guys.

2 Likes

Please note that my script was for an internal private IP address. You’d have to call something like:
curl -4 icanhazip.com
to get your public IP address.

2 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.