I need to check if specified domain (variable) exists and if it exists I have to read it's DNS zone.

I dealt with this in various ways, and almost each worked for some time and then stopped.

Has anyone tried do do something like this? I need it to work on Dathorn server. Domains that are checked are not necessarily hosted on Dathorn.