Fix NPE while resolving DNS