Use an asynchronous resolver (probably not an option for us).
Run the resolve in a thread. Currently the only place ureq uses threads outside of tests is when handling a socks stream, and there's a comment on that code that suggests it would be better to set a read timeout on the upstream socks implementation. But some judicious use of threads in ureq is probably not a bad idea.
Right now ureq has no way to time out DNS lookups. It uses to_socket_addrs, which says:
Under the hood, I believe this uses getaddrinfo on Linux, which does not allow setting a timeout.
Some documentation about how curl handles this is here: https://github.com/curl/curl/blob/26d2755d7c3181e90e46014778941bff53d2309f/lib/hostip.c#L91-L115. It sounds like the options are:
This may not be a terribly big priority because in practice getaddrinfo does have built-in timeouts on many systems. For instance, on Linux the default config has a timeout of 5s for name resolution. The Windows default is 15s.