IPv4 for APT

Ref: http://unix.stackexchange.com/a/13263/20241

At times, apt may try IPv6 to resolve a domain name. In which case, it may not be desirable and sometimes, it just doesn’t work for that particular server. So, to let apt to use only ipv4 for DNS resolution…

Edit /etc/gai.conf

uncomment the following line…

precedence ::ffff:0:0/96 100

If the above line doesn’t exist, just insert it at the bottom or at the top of the file!

Verify the changes with the command (before and after the changes)…

telnet security.ubuntu.com


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s