Both 2 and 3 send valid dns packet to echo server or dns server.
For 4, echo server receives same data as I sent, which is expected.
What did you see instead?
The data sent by 2 is a valid dns packet. If I change destination to 22.214.171.124:53, I could get the dns result.
The data sent by 3 is not a valid dns packet. If I change destination to 126.96.36.199:53, I can't get the dns result.
The following is the data received from echo server, I found the invalid data would always have two more bytes in the front of the packet. These two bytes seems to be the length of the following bytes whenever I change the hostname.
@davecheney Thanks for advice! I would use network directly in dailer for further usage.
As the test in this issue, I've printed the network and address before c.Dail. They are always "udp", so I simplify it.