2

PHP script to retrieve a DNS record from a custom nameserver

 1 year ago
source link: https://gist.github.com/bohwaz/ddc61c4f7e031c3221a89981e70b830c
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

PHP script to retrieve a DNS record from a custom nameserver · GitHub

Instantly share code, notes, and snippets.

PHP script to retrieve a DNS record from a custom nameserver

I saw this referenced in your comment on php.net

I really like the minimal approach, personally I ran into a few issues I've been unable to solve. Not expecting anything just wanted to make the note in case if was of interest to you:

  • For more reasonable length responses for multi answer records, it seems there's an extra character that doesn't get trimmed out in the response. Query TXT records for northskytech.com, for example. The first array item is correct, but the other 3 have an extra leading character.

  • Less important but something I noticed: For multi-answer records, like querying all TXT records for GitHub.com, it returns no results (I suspect the response is too large for the buffer?)

In either case, appreciate you sharing your solution, thank you!


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK