Unable to resolve server for apt-get

When trying to update or install a package from apt-get i get. Err trusty-security Release.gpg Could not resolve ‘’ Err trusty Release.gpg Could not resolve ‘

When i use dig it says there are no errors but it seems to ignore the first 2 nameservers (which I’m guessing are digitaloceans?) listed in /etc/resolv.conf and default to google dns. However ping says unknown host . I have had this sort of thing happen before when raspibian changed their repository servers.

; <<>> DiG 9.9.5-3ubuntu0.2-Ubuntu <<>> ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 47974 ;; flags: qr rd ra ad; QUERY: 1, ANSWER: 13, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 512 ;; QUESTION SECTION: ;. IN NS

;; ANSWER SECTION: . 19376 IN NS . 19376 IN NS . 19376 IN NS . 19376 IN NS . 19376 IN NS . 19376 IN NS . 19376 IN NS . 19376 IN NS . 19376 IN NS . 19376 IN NS . 19376 IN NS . 19376 IN NS . 19376 IN NS

;; Query time: 9 msec ;; SERVER: ;; WHEN: Wed Apr 15 19:08:30 EDT 2015 ;; MSG SIZE rcvd: 239


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

It seems that when i created the server i enabled ipv6 and apt-get only seems to be able to use ipv6 even tho it has ipv4 dns servers listed I guess apt-get doesn’t just have domain names it has ip addresses too? When i disabled ipv6 in /etcd/efualt/ufw it stopped working and after enabling it i can update again.