Gitlab runner fails dns lookup of git host after moving to AWS

Running a docker build with gitlab-ci. Works well locally, but we are moving runners to AWS on ubuntu 20 and it appears that DNS is not working in the containers.

Runner is 14.0.1, local is 12.9.0

Tried many things, none of them work so far. Here is runner config with dns entry as you can see – this does not work.

concurrent = 1
check_interval = 0

  session_timeout = 1800

  name = "aws-runner"
  url = ""
  token = "70082342423423423423423"
  executor = "docker"
  environment = ["GIT_SSL_NO_VERIFY=true"]
    tls_verify = false
    image = "docker:stable"
    dns = ["", ""]
    privileged = true
    disable_entrypoint_overwrite = false
    oom_kill_disable = false
    disable_cache = false
    volumes = ["/cache"]
    shm_size = 0

Tried adding local DNS Server to docker config hoping ti could resolve on it’s own:

root@git-runner:/etc/docker# cat /etc/docker/daemon.json 
    "dns": ["", ""]

That doesn’t work either.

I am using three stages in gitlab-ci, and I tried this hack in the build stage and it seems to work, however does not work in the package stage since it needs the dns entry prior to running script section.

  - build
  - package
  - deploy

# Build with maven, result is the jar file
  image: maven:3.5.2-jdk-8
  stage: build
   - "ls"
   - "echo '' >> /etc/hosts"
   - "cat /etc/hosts"
   - "mvn clean install package"
      - target/*.jar

  stage: package
  environment: dev

Any ideas greatly appreciated, perhas Is there a way to statically set the git repo DNS address globally in the config, not finding any variables for this in the doc.