Change DNS records via doctl

Is there a way to get/add/modify DNS records in Digital Ocean via doctl or another command line utility? I was unable to find anything that looked relevant via doctl help.

It looks like worst case I could call the HTTP API directly, although I’m not sure how I would need to get the correct authentication credentials.

curl '' -X PUT
-H 'Cookie: ... _digitalocean2_session_v4=SOME_AUTH_TOKEN?; ...'
--data-raw '{"record":{"name":"_dnslink.www.MY_DOMAIN","record_type":"TXT","created_at":"2020-08-30T22:39:51.000Z","updated_at":"2020-09-24T03:55:21.000Z","port":null,"weight":null,"ttl":"300","data_record":"dnslink=/ipfs/IPFS_HASH","priority":null,"tag":null,"flags":null,"droplet_id":null,"floating_ip_id":null,"load_balancer_id":null}}'

My use case is I have a GitHub Action that uploads a web app to IPFS ( that is served via a _dnslink.DOMAIN TXT record via CloudFlare (, section Setting Up Your DNS Records to Point to Cloudflare). After the upload happens, I need to update that _dnslink record to point to the new IPFS hash (_dnslink.DOMAIN TXT “dnslink=/ipfs/IPFS_HASH”)

Action yml (modified for clarity) in case it helps:

name: web


    runs-on: ubuntu-latest

    - uses: actions/checkout@v2

    - name: Install Node.js
      uses: actions/setup-node@v1
        node-version: 12.x

    - name: Install npm dependencies
      run: npm install

    - name: Typescript checks
      run: npm run tsc
    - name: Webpack build 
      run: npm run build

    - name: Upload to Pinata (IPFS) 
      uses: aquiladev/ipfs-action@v0.1.4
        path: ./dist
        service: pinata
        pinataKey: ${{ secrets.PINATA_KEY }}
        pinataSecret: ${{ secrets.PINATA_SECRET }}

    - name: Install doctl
      uses: digitalocean/action-doctl@v2
        token: ${{ secrets.DIGITAL_OCEAN_DOCKER_AUTH }}
    - name: Update dnslink record
      # HELP What should I do here?
      run: doctl ...

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Accepted Answer

Hi, hope you’re doing well. I did a little digging and found this documentation kinda buried on DO’s site:

It does look like you can perform the necessary DNS actions via doctl but they are under the “compute” area of functionality.

Hope this helps and let us know if you have any other questions or feedback - good luck!