Answer the question
In order to leave comments, you need to log in
How to set up a DNS server for a host running in docker?
Good day.
The computer now has dnsmasq installed in DNS server mode. There is only one line in the config so far:
address=/loc/127.0.0.1
dns:
image: andyshinn/dnsmasq:2.78
volumes:
- ${PATH_TO_CONFIGS}/dnsmasq/dnsmasq.conf:/etc/dnsmasq.conf
cap_add:
- NET_ADMIN
ports:
- 53:53/tcp
- 53:53/udp
$ sudo netstat -pna | grep :53
tcp 0 0 127.0.1.1:53 0.0.0.0:* LISTEN 2064/dnsmasq
udp 0 0 0.0.0.0:5353 0.0.0.0:* 1275/avahi-daemon:
udp 0 0 127.0.1.1:53 0.0.0.0:* 2064/dnsmasq
udp6 0 0 :::5353 :::* 1275/avahi-daemon:
Answer the question
In order to leave comments, you need to log in
You need to run dnsmasq and give it a static ip. do not specify public port, as it is busy.
You can see an example for compose here. linux-notes.org/ispol-zovanie-staticheskogo-ip-adr...
You can create a subnet manually and run it yourself
docker network create some_network
docker run --network some_network --ip 172.19.5.5 --restart=unless-stopped -d dnsmasq
echo "nameserver 172.19.5.5" | sudo tee --append /etc/resolvconf/resolv.conf.d/tail
sudo resolvconf -u
dig postgres.my-project.loc
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question