replacing scan through DNS with just fetching the desired record.

The call to fog's zone.records.all only returns the first 98 records (sorted alphabetically) so fails if you're trying to change the record for a host named later in the alphabet.  Instead of replacing it with zone.records.all! (which does return all records), I replaced it with a call to fetch the actual record we're interested in, skipping the scan.