in reply to Capturing STDERR with -
exec("/bin/sh", "-c", "/usr/sbin/nslookup -q=$query_type $input $names +erver 2>&1"); [download]
HTH, --traveler