kitchen-dokken icon indicating copy to clipboard operation
kitchen-dokken copied to clipboard

dns issues

Open bsamsom opened this issue 2 years ago • 2 comments

:speaking_head: Foreword

I can't for the life of me get DNS to work via the default nameserver of 127.0.0.11, overridding it with a dns setting deosnt change the value of the nameserver in /etc/resolv.conf

:ghost: Brief Description

I've tried overriding DNS with

platforms:
  - name: centos-7
    driver:
      image: dokken/centos-7
      pid_one_command: '/usr/sbin/init'
      dns:
        - 8.8.8.8
      volumes:
        - /sys/fs/cgroup:/sys/fs/cgroup:ro
      privileged: true

in .kitchen.yml, but /etc/resolv.conf still has 127.0.0.11 as its only nameserver. If I manually alter /etc/resolv.conf to hit 8.8.8.8 instead, name resolution works.

Version

2.17.0

Environment

docker 4.2.0 on macOS Monterey 12.3.1

Scenario

Be able to hit https://rubygems.org/ or any other site from the contianer via a dns nameserver provided in .kitchen.yml

Steps to Reproduce

---
driver:
  name: dokken
  chef_version: 14

transport:
  name: dokken

provisioner:
  name: dokken
  
platforms:
  - name: centos-7
    driver:
      image: dokken/centos-7
      pid_one_command: '/usr/sbin/init'
      dns:
        - 8.8.8.8
      volumes:
        - /sys/fs/cgroup:/sys/fs/cgroup:ro
      privileged: true

Expected Result

log into container and run cat /etc/resolv.conf and see the set nameserver(8.8.8.8 in this example) nameserver 8.8.8.8

Actual Result

only see the default nameserver in /etc/resolv.conf nameserver 127.0.0.11

:heavy_plus_sign: Additional context

This is the same as the closed issue: https://github.com/test-kitchen/kitchen-dokken/issues/247

bsamsom avatar Apr 07 '22 15:04 bsamsom

Definitly something wierd going on with dokken/dokker dns, in order for the dokken container to reach other docker containers i needed to:

  1. run docker network inspect dokken
  2. grab the gateway address
  3. use the gateway adress and the port number of the other containter to reach it, it cant be directly reached by container name, only by 'gateway ip:port'

bsamsom avatar Apr 25 '22 13:04 bsamsom

Same issue is observed when using podman - /etc/resolv.conf is not updated as per kitchen.yml dns section.

hunter86bg avatar Jul 20 '23 11:07 hunter86bg