Add nameserver option and more error handling