rust-http
rust-http copied to clipboard
Perform DNS resolution in RequestWriter
DNS lookup was implemented in mozilla/rust#9000; the client needs to use this to look up a remote address based on the hostname.
I'm not certain what should happen in case of an unknown hostname.
I'm not certain what the deal is with regards to multiple IP addresses being returned.
I assume you just want to use the first address. Maybe try each address in order until one resolves. Most DNS servers hand out the addresses in a different order (round robin) each time a client queries the server. It can have a load balancing effect if you always pick the first address in the list since other clients receive the list of IPs in a different order.