Unable to resolve github.com using curl

I’m trying to download a release artifact from github.com within a github action workflow, but I keep getting the following DNS error:

curl: (6) Could not resolve host: github.com

Here is the resolve.conf I retrieved from the container:

nameserver 127.0.0.53
options edns0 trust-ad
search eufn0zsozglefnauzjqbs2pvjc.cx.internal.cloudapp.net

Anyone with an idea of why the runner can’t access this resource?

Could you share more details about your workflow, ideally a link to the run or at least the file? The resolv.conf file doesn’t have any obvious error.

1 Like

The repo is private, but I can share a copy of the github action:

name: Ansible

on:
  push:
    branches:
      - master
  pull_request:

jobs:
  ansible:
    name: Ansible
    runs-on: ubuntu-latest
    env:
      MACHINE: raspberrypi
      SOPS_VERSION: 3.7.1

    defaults:
      run:
        shell: bash

    steps:
    - uses: actions/checkout@v2

    - name: Install sops
      run: |
        URL="https://github.com/mozilla/sops/releases/download/v${SOPS_VERSION}/sops_${SOPS_VERSION}_amd64.deb"
        curl "$URL" -o sops.deb
        sudo apt-get install -y ./sops.deb

The “install sops” step fails because curl isn’t able to resolve github.com

That’s even weirder, there’s nothing in there that should change DNS behavior. If you haven’t removed any confidential steps in the workflow above, I can think of only two options:

  • Something’s broken on the runner VMs. Seems unlikely because I haven’t seen similar reports on the forum, though.
  • There’s a non-obvious error in the URL or curl command, maybe a non-printing character.

Whoops, false alarm!

I set up a VPN at the beginning of the job, which interfered with the GitHub action runner’s routing. and it was incorrectly setup with only an IPv4 nameserver. For some reason, GitHub action runners don’t work with IPv4-only addresses and require IPv6 resolvers to route traffic correctly.

Adding an IPv6 DNS nameserver to the VPN config fixed the problem.

2 Likes