I'm experiencing the weirdest internet issue. I use Comcast Xfinity in El Cerrito, CA. I have a new Arris SB6190 cable modem running firmware version 9.1.93N. A few days ago, I noticed that new tabs start taking a few seconds to load, and curl requests to example.com took ~5.1 seconds. However, if I specified -4 or -6 to curl, it resolved immediately. I immediately suspected DNS, but "host" resolved immediately as well.
So this was too weird to ignore. I set my resolv.conf to point to 8.8.8.8 (instead of my EdgeRouter X) and did:
time strace -f -T curl -s http://www.example.com > /dev/null 2> bad
time strace -f -T curl -4 -s http://www.example.com > /dev/null 2> good
Now if you look at the resulting logs, you'll see that curl starts a new thread to handle DNS resolution. In the good logs, the relevant bit looks like:
[pid 12438] socket(AF_INET, SOCK_DGRAM|SOCK_NONBLOCK, IPPROTO_IP) = 3 <0.000005>