Home > other >  Container network problems
Container network problems

Time:02-08

I create a DNS server on his MacBook, console test normal:
 
% nslookup 127.0.0.1 www.baidu.com
Server: 127.0.0.1
Address: 127.0.0.1 # 53
The Non - authoritative answer:
www.baidu.com canonical name=www.a.shifen.com.
Name: www.a.shifen.com
Address: 110.242.68.3
Name: www.a.shifen.com
Address: 110.242.68.4
%


But I started a Debian container, the test fails:
 
% docker run - it -.net=host - DNS 127.0.0.1 debian: arcade bash
WARNING: Localhost DNS setting (- DNS=127.0.0.1) may fail in containers.
Root @ docker - desktop:/# ping www.baidu.com
Ping: www.baidu.com: Temporary failure in the name resolution
Root @ docker - desktop:/#


What's the problem?
  • Related