Trouble connecting to Exercism & Github API

Greeting,

I am running into problems when trying to use the Exercism CLI and was hoping someone could help me out finding the cause of this

I’m trying to run exercism locally on a linux laptop, however it seems it can’t connect to both github and exercism API.

Error:
GitHub:
    * https://api.github.com
    * [Get https://api.github.com: dial tcp: lookup api.github.com on [::1]:53: read udp [::1]:42732->[::1]:53: read: connection refused]
    * 530.59µs

Exercism:
    * https://api.exercism.io/v1/ping
    * [Get https://api.exercism.io/v1/ping: dial tcp: lookup api.exercism.io on [::1]:53: read udp [::1]:60289->[::1]:53: read: connection refused]
    * 300.25µs

Tried running it as sudo but that doesn’t work either and my internet is working fine.

Do you happen to know if your system uses systemd-resolved to resolve DNS names?

Could you try running:

resolvectl query api.github.com
resolvectl query api.exercism.io
ls /etc/systemd/resolved.conf

Let us know the response.

The reason I’m asking this is because if you do, then the issue may be that your systemd-resolved has not (yet) been configured to understand ipv6. We can help with this if this is the case.

Dear @SleeplessByte ,

I get the following responses when executing your commands:

resolvectl query api.github.com
api.github.com: 140.82.121.5                   -- link: wlp3s0

-- Information acquired via protocol DNS in 91.1ms.
-- Data is authenticated: no; Data was acquired via local or encrypted transport: no
-- Data from: network

resolvectl query api.exercism.io
api.exercism.io: 52.222.139.108                -- link: wlp3s0
                 52.222.139.104                -- link: wlp3s0
                 52.222.139.92                 -- link: wlp3s0
                 52.222.139.94                 -- link: wlp3s0
                 (api.exercism.org)

-- Information acquired via protocol DNS in 64.9ms.
-- Data is authenticated: no; Data was acquired via local or encrypted transport: no
-- Data from: cache network

ls /etc/systemd/resolved.conf
/etc/systemd/resolved.conf

Great.

What this shows us is that you can actually resolve an IP address for both hosts and also that the utility i mentioned is actually installed on your device.

The problem most likely is that the utility isn’t configured correctly to resolve the loopback IPv6 address.

This can be resolved by editing that configuration file and adding:

DNSStubListenerExtra=[::1]:53

Notice the loopback [::1] and the aforementioned port 53 from your error messages.

After changing this file, reload the service:

systemctl restart systemd-resolved.service

Can you let us know if this works for you?

1 Like

That worked indeed! @SleeplessByte

Thanks for the help

1 Like

Sweet!

Have fun with Exercism!

2 Likes

Thanks for helping out @SleeplessByte :pray: