Fixed DNS config lookup, added new exception classes