Wednesday, February 15, 2012

DNS Cache Issues

It could be something in my router, or something to do with the way large scale cloud services are routing for load sharing.   Whatever it is, sites like plus.google.com keep going off-line because the certificate doesn't match "myshoppify.com", which seems to be another Google property.

So I set up a launchd job to flush the DNS cache every four hours. The following was saved at /Library/LaunchAgents/com.agilemarkup.fixDNSCachingIssues.plist, and loaded with launchctl load ...

Got to get me a new router...


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>KeepAlive</key>
  <true/>
  <key>Label</key>
  <string>com.agilemarkup.fixDNSCachingIssues</string>

  <key>ProgramArguments</key>
  <array>
    <string>/usr/bin/dscacheutil</string>
    <string>-flushcache</string>
  </array>
  
  <key>RunAtLoad</key>
  <true/>

  <key>StartInterval</key>
  <integer>14400</integer>
  
  <key>StandardErrorPath</key>
  <string>/var/log/dnscacheutil.err.log</string>

  <key>StandardOutPath</key>
  <string>/var/log/dnscacheutil.out.log</string>
  
  <key>WorkingDirectory</key>
  <string>/tmp</string>
</dict>
</plist>

Post a Comment