Bind9, slow DNS lookup
I just installed a new router and it when I try to do a resolve of a domain name it went slow.
I tested it with:
time dig www.google.com
The tested returned 20msec and the connection timed out When I
retried it was there instantly. Add that moment I went to search on
google and found out that debian uses Bind9 and is standard configured
to use ipv6. Since i don’t use ipv6 Bind9 still tried to resolve ip on
the ipv6 and as it timed out Bind9 switches to ipv4.
If you want to use default ipv4 instead of ipv6 modify /etc/default/bind9:
vi /etc/default/bind9
OPTIONS="-4 -u bind"
//-u bind = daemon will run as the unprivileged user 'bind'
//-4 = to use ipv4 only.
And afterwards restart Bind, it works for me.