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_server]
  session_timeout = 1800

[[runners]]
  name = "aws-runner"
  url = "https://git.mysite.com/"
  token = "70082342423423423423423"
  executor = "docker"
  environment = ["GIT_SSL_NO_VERIFY=true"]
  [runners.custom_build_dir]
  [runners.cache]
    [runners.cache.s3]
    [runners.cache.gcs]
    [runners.cache.azure]
  [runners.docker]
    tls_verify = false
    image = "docker:stable"
    dns = ["10.80.100.120", "1.1.1.1"]
    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": ["10.80.100.120", "1.1.1.1"]
}

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.

stages:
  - build
  - package
  - deploy

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

docker-package-dev:
  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.

Regards