Ubuntu 18.04 Slow

On two new Ubuntu 18.04 installations, internet access was extremely slow on the first access of a website. I eventually tracked it down to IPv6 DNS, for instance:
dig slashdot.org A
would respond immediately, but
dig slashdot.org AAAA
would hang for a while then return
;; connection timed out; no servers could be reached
I checked the name servers returned by my ISP that my router was using and they worked fine. It was only when using the default DNS returned by my router’s DHCP that it hung. The reason for this was that IPv6 was disabled at the router, a NetGear R6700v2. To fix, log in to the router’s administration web page and go to Advanced -> Advanced Setup -> IPv6 and change Internet Connection Type from Disabled to DHCP.