I want to customize the DNS configuration for a new container. I am using the --hostname flag to set thehostname of a new container. Below is the docker command for testing the hostname:
docker run --rm --hostname rando alpine:latest nslookup rando
The output is like below:
Server: xxx.xxx.xxx.2Address: xxx.xxx.xxx.2:53** server can't find rando.localdomain: NXDOMAIN** server can't find rando.localdomain: NXDOMAIN
I am using the ubuntu 19.10 version. Below is the content from the /etc/resolv.conf
file:
# This file is managed by man:systemd-resolved(8). Do not edit.## This is a dynamic resolv.conf file for connecting local clients directly to# all known uplink DNS servers. This file lists all configured search domains.## Third party programs must not access this file directly, but only through the# symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a different way,# replace this symlink by a static file or a different symlink.## See man:systemd-resolved.service(8) for details about the supported modes of# operation for /etc/resolv.conf.nameserver xxx.xxx.xx.2search localdomain
I will appreciate any help in solving this issue.
Regards,Rando.
P.S
I tried to create the bridge network explicitly but still didn't work. Below is the result of the execution:
Below is the content from /etc/resolv.conf
file inside container: