The UltraDNS API and Powershell Pt. 2

In a previous post, I outlined using Powershell to work with the UltraDNS API. Here is an update with a screen shot of the GUI. As part of this project, I implemented a web front end that allows anyone on my team to trigger a DNS failover by domain, client, or datacenter. This web front end is used for many different functions and utilizes PHP for the web application, which calls Powershell scripts that do most of the heavy lifting.

This also includes several automated reports that gather a variety of different data; SAN statistics, patching reports, and more. This makes it easy to abstract running Powershell scripts for team members or other staff. They can access the web interface, kick off actions, and read reports. Future enhancements are pretty much unlimited.

Why roll our own solution? There is a lack of products that do anything like this, and this approach allows us to customize things to our own needs.

ultrandswebfront

2 thoughts on “The UltraDNS API and Powershell Pt. 2

  • This is great. I’m looking to implement something like this with UltraDNS. Can you post your code for actually updating the DNS record? I’ll probably skip the GUI and just have a script to run.

    • Wow, I’m way behind on this one here, but here’s a function that wound up in my module. This may need some tuning though;

      function set-udnsARecord {

      param (
      [string]$token,
      [string]$IP,
      [string]$domain,
      [string]$TTL
      )

      # Change a domain IP.
      $uri = “https://restapi.ultradns.com/v1/zones/$domain./rrsets/A/$domain”

      $headers = @{

      authorization=”Bearer $token”;

      }

      $body =”{
      `”ttl`”: $TTL,
      `”rdata`”: [`”$IP`”]
      }”

      Invoke-RestMethod -Uri $uri -Headers $headers -Body $body -Method PUT -ContentType “application/json”
      }

Leave a Reply

Leave a Reply

Your email address will not be published. Required fields are marked *