Use checkdnsrr() instead of gethostbyname()