Impossible to install atom due connection refused

When I try to install atom I receive connection refused:

sudo snap install atom
error: cannot install "atom": Get
       https://api.snapcraft.io/api/v1/snaps/details/atom?channel=stable&fields=anon_download_url%2Carchitecture%2Cchannel%2Cdownload_sha3_384%2Csummary%2Cdescription%2Cdeltas%2Cbinary_filesize%2Cdownload_url%2Cepoch%2Cicon_url%2Clast_updated%2Cpackage_name%2Cprices%2Cpublisher%2Cratings_average%2Crevision%2Cscreenshot_urls%2Csnap_id%2Csupport_url%2Ccontact%2Ctitle%2Ccontent%2Cversion%2Corigin%2Cdeveloper_id%2Cprivate%2Cconfinement%2Cchannel_maps_list:
       dial tcp: lookup api.snapcraft.io on [::1]:53: read udp
       [::1]:55918->[::1]:53: read: connection refused

This is my snap version:

snap version
snap    2.27.6
snapd   2.27.6
series  16
ubuntu  16.04
kernel  4.10.0-35-generic

Looks like your computer can’t resolve api.snapcraft.io for some reason. Can you for example browse to http://api.snapcraft.io/? What about curl -v http://api.snapcraft.io? or dig api.snapcraft.io?

▶ curl -v http://api.snapcraft.io
* Rebuilt URL to: http://api.snapcraft.io/
*   Trying 91.189.92.20...
* Connected to api.snapcraft.io (91.189.92.20) port 80 (#0)
> GET / HTTP/1.1
> Host: api.snapcraft.io
> User-Agent: curl/7.47.0
> Accept: */*
> 
< HTTP/1.1 200 OK
< Server: gunicorn/19.7.1
< Date: Sun, 24 Sep 2017 10:36:42 GMT
< Content-Type: text/html; charset=utf-8
< Content-Length: 49
< X-VCS-Revision: f41dc3f
< X-Request-Id: b96cc206-a785-4a90-a54a-2dc4fe6015fd
< 
snapdevicegw service - Copyright 2017 Canonical.
* Connection #0 to host api.snapcraft.io left intact

▶ dig api.snapcraft.io

; <<>> DiG 9.10.3-P4-Ubuntu <<>> api.snapcraft.io
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 35691
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;api.snapcraft.io.		IN	A

;; ANSWER SECTION:
api.snapcraft.io.	316	IN	A	91.189.92.20
api.snapcraft.io.	316	IN	A	91.189.92.19

;; Query time: 70 msec
;; SERVER: 127.0.1.1#53(127.0.1.1)
;; WHEN: Sun Sep 24 12:37:12 CEST 2017
;; MSG SIZE  rcvd: 77

traceroute api.snapcraft.io
traceroute to api.snapcraft.io (91.189.92.19), 30 hops max, 60 byte packets
 1  192.168.178.1 (192.168.178.1)  7.493 ms  7.407 ms  7.359 ms
 2  192.0.0.1 (192.0.0.1)  39.153 ms  40.125 ms  40.597 ms
 3  ae0.r3.muc7.m-online.net (212.18.6.87)  42.063 ms  42.663 ms  44.141 ms
 4  ae52.bar1.Munich1.Level3.net (62.140.24.49)  45.115 ms  46.343 ms  48.563 ms
 5  ae-124-3510.edge5.london1.Level3.net (4.69.166.37)  64.492 ms  65.450 ms  68.552 ms
 6  SOURCE-MANA.edge5.London1.Level3.net (212.187.138.82)  68.717 ms  54.462 ms  55.499 ms
 7  ninjask.canonical.com (91.189.93.24)  59.798 ms  57.637 ms  59.332 ms
 8  * * *
 9  * * *
10  * * *
11  * * *
12  * * *
13  * * *
14  * * *
15  * * *
16  * * *
17  * * *
18  * * *
19  * * *
20  * * *
21  * * *
22  * * *
23  * * *
24  * * *
25  * * *
26  * * *
27  * * *
28  * * *
29  * * *
30  * * *

Looks fine to me, and I tried to install atom inside a 16.04 container and it worked perfectly for me. Maybe snapd uses their own DNS servers? That would be weird… or maybe it’s just a bad error message.

I restarted the PC and now it works :thinking: well, let’s say was a temporary error