1

Good morning,

I'm currently facing a small problem. To create some automated process, I need to be able to check If a hostname has a CAA record.

CAA record are needed by letsencrypt to generate certificate. I wanted to use dns_get_record to check my DNS, but unfortunately for me, we are using PHP 5.6 and dns_get_record in php 5.6 does not fetch those record.

So I was wondering if anyone had any idea in php, on how I could check if an hostname has a CAA record.

Thanks in adavance

LinChan
  • 417
  • 1
  • 5
  • 17

1 Answers1

0

Unfortunately, PHP doesn't provide any other tools for this. You'll have to settle with one of the following:

  • Upgrade PHP (just do it, you'll have to anyway and it's not as painful as you may think)
  • Find a user-space DNS-resolver library that works on PHP 5.6 (there are some, but I don't know of any with CAA support)
  • Use something like exec('dig caa <domainNameHere>') to hack around it
  • Do this outside of PHP
Narf
  • 14,600
  • 3
  • 37
  • 66
  • In the end I could not find something so I used dig like this exec('dig ' . $host . ' type257 +noall +answer', $output); – LinChan Oct 18 '17 at 12:05