Pages

Tuesday, 29 September 2020

DNS not working inside docker containers on CentOS 8

ISSUES

Till today (Sep 30, 2020), docker is still NOT officially supported on CentOS 8 due to the conflicts between Docker.com and RedHat.

When installed on CentOS 8, docker containers run into DNS issues right away. 

There're two ways to solve this for now.

SOLUTION1

Change firewalld's backend from nftables to iptables

# cat /etc/firewalld/firewall.conf  | grep Backend
FirewallBackend=iptables
# systemctl restart firewalld

SOLUTION2

Add SNAT to the public zone.

# firewall-cmd --zone=public --add-masquerade --permanent
# firewall-cmd --reload
# firewall-cmd --list-all
public (active)
  target: default
  icmp-block-inversion: no
  interfaces: enp0s25
  sources:
  services: cockpit dhcpv6-client http smtp ssh
  ports: 8888/udp 8000/tcp 8087/tcp
  protocols:
  masquerade: yes
  forward-ports:
  source-ports:
  icmp-blocks:
  rich rules:

USEFUL links

https://github.com/docker/for-linux/issues/957

No comments:

Post a Comment