# DNS config not working

**URL:** <https://forums.suse.com/t/dns-config-not-working/12275>\
**Category:** RancherOS\
**Created:** [November 7, 2018, 5:15pm UTC](https://forums.suse.com/t/dns-config-not-working/12275 "2018-11-07T17:15:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cyber](https://avatars.discourse-cdn.com/v4/letter/c/ecd19e/32.png) [@Cyber](https://forums.suse.com/u/Cyber)\
**Post date:** [November 7, 2018, 5:15pm UTC](https://forums.suse.com/t/dns-config-not-working/12275/1 "2018-11-07T17:15:33Z")

</div>

Hi,

i cannot resolve hostnames on my rancheros machine. Ping works fine. Internet connection works fine (downloading images etc.)

```
[rancher@rancher ~]$ ping 192.168.100.10
PING 192.168.100.10 (192.168.100.10): 56 data bytes
64 bytes from 192.168.100.10: seq=0 ttl=128 time=0.895 ms
64 bytes from 192.168.100.10: seq=1 ttl=128 time=0.547 ms
64 bytes from 192.168.100.10: seq=2 ttl=128 time=0.483 ms

```

However

```
ping: bad address 'rancher.mydomain.com'
ping: bad address 'google.com'

```

At the start i thought it is a problem with the docker container inside the system-docker but after trying a network setup i figured out that the container is linked to the host network configuration and should be able to resolv a hostname over dns.

My vonfig looks like

```
#cloud-config
rancher:
  environment:
    EXTRA_CMDLINE: /init
  network:
    dns:
      search:
      - mydomain
    interfaces:
      eth0:
        address: 192.168.100.99/24
        dhcp: false
        gateway: 192.168.100.1
        mtu: 1500
    nameservers:
    - 192.168.100.10
    - 192.168.100.11
  services_include:
    rancher-server: true
    rancher-server-stable: false
  state:
    autoformat:
    - /dev/sda
    - /dev/sda1
    dev: LABEL=RANCHER_STATE
    wait: true
  system_docker:
    bridge: ""

```

I am using a VM in bridge mode setup. (DNS is working for any other VM on that server; The server is bare metal in my own Network)

```
NAME="RancherOS"
VERSION=v1.4.2

```

Can anybody help me with further input? Actually i am new to docker and rancheros so i probably just forgott a step in the configuration process.

Thank you Niklas

---

<div class="post-metadata">

**Author:** ![Cyber](https://avatars.discourse-cdn.com/v4/letter/c/ecd19e/32.png) [@Cyber](https://forums.suse.com/u/Cyber)\
**Post date:** [November 8, 2018, 1:46pm UTC](https://forums.suse.com/t/dns-config-not-working/12275/2 "2018-11-08T13:46:58Z")

</div>

ok, i failed my setup. i said in my cloud config something similiar to this:

`sudo ros config get rancher.network.nameservers "['192.168.100.10','192.168.100.11']"`  
instead of  
`sudo ros config set rancher.network.dns.nameservers "['192.168.100.10','192.168.100.11']"`  
now everything works fine.

i typed

```
#cloud-config
rancher:
  network:
    nameservers:
    - 192.168.100.10
    - 192.168.100.11

```

instead of

```
#cloud-config
rancher:
  network:
    dns:
      nameservers:
      - 192.168.100.10
      - 192.168.100.11

```

Actually the command

> sudo ros config validate -i cloud-config.yml

wasnt responding with an error. Where is the right place to open an issue for this?

---

<div class="post-metadata">

**Author:** ![Jason-ZW](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/jason-zw/32/4607_2.png) [@Jason-ZW](https://forums.suse.com/u/Jason-ZW)\
**Post date:** [November 12, 2018, 8:22am UTC](https://forums.suse.com/t/dns-config-not-working/12275/3 "2018-11-12T08:22:31Z")

</div>

I can not reproduce your issue.  
Validate failed when I typed `rancher.network.nameservers` then run the command `ros c validate -i cloud-config.yml`.  
If you still have questions, you can open an issue on [github](https://github.com/rancher/os/issues)

```auto
#cloud-config
rancher:
  network:
    nameservers:
    - 192.168.1.1
    - 192.168.1.2

```

```auto
[root@rancheros conf]# ros c validate -i cloud-config.yml
ERRO[0000] nameservers: Additional property nameservers is not allowed

```
