解决docker中DNS查询的问题
I got a dns error that i can not access dns server,
that caused by : /etc/resolv.conf
you can find this in host-machine
nameserver 127.0.1.1
search gd1.qingcloud.com
Yes, you can find the process named "dnsmasq" listening 53 port, so you got nameserver 127.0.1.1 firstly.
however, it's not same with the docker machine,
search gd1.qingcloud.com
nameserver 8.8.8.8
nameserver 8.8.4.4
you can find this from /etc/resolv.conf
the based image is download from docker offical via docker pull ubuntu.
so you get 8 repeats 4 times dns server.
however, WTF this at start ? => search gd1.qingcloud.com
in docker, you don't have dnsmasq, you can not find gd1.qingcloud.com, have not configure nameserver 127.0.0.1
you have do this to fix it:
nameserver 202.96.209.133 # valid nameserver ip address, remove "search gd1.qingcloud.com"
nameserver 8.8.8.8
nameserver 8.8.4.4
-----------------------
一种更好的方式是直接安装 dnsmasq
apt-get install dnsmasq
service dnsmasq start
其中报错:
* Starting DNS forwarder and DHCP server dnsmasq
dnsmasq: setting capabilities failed: Operation not permitted
解决方法:
https://www.damagehead.com/blog/2015/04/28/deploying-a-dns-server-using-docker/
添加配置:
conf-dir=/etc/dnsmasq.d/,*.conf interface=lo
interface=eth0
interface=docker0
resolv-file=/etc/resolv.dnsmasq.conf
user=root
service dnsmasq start
解决docker中DNS查询的问题的更多相关文章
- 解决docker中使用nginx做负载均衡时并发过高时的一些问题
# 解决docker中使用nginx做负载均衡时并发过高时的一些问题 1.问题产生原因: 由于通过nginx作为负载均衡服务,在访问并发数量达到一定量级时jmeter报错. nginx日志关键信息:a ...
- 解决Docker中运行的MySQL中文乱码
docker exec -it mysql bash 如果没有安装vim,请参考 解决Docker容器中不能用vim编辑文件 vim /etc/mysql/mysql.conf.d/mysql.cnf ...
- 【docker】【redis】2.docker上设置redis集群---Redis Cluster部署【集群服务】【解决在docker中redis启动后,状态为Restarting,日志报错:Configured to not listen anywhere, exiting.问题】【Waiting for the cluster to join...问题】
参考地址:https://www.cnblogs.com/zhoujinyi/p/6477133.html https://www.cnblogs.com/cxbhakim/p/9151720.htm ...
- 解决docker容器中Centos7系统的中文乱码
解决docker容器中Centos7系统的中文乱码问题有如下两种方案: 第一种只能临时解决中文乱码: 在命令行中执行如下命令: # localedef -i zh_CN -f UTF-8 zh_CN. ...
- 解决jenkins日志爆满 DNS查询错误
一.故障 公司的jenkins因为日志量太大把磁盘占满,进而影响了其他程序,仔细一看日志文件"/var/log/jenkins/jenkins.log"几分钟产生了30G的日志 日 ...
- 记录未解决的问题:docker中无法启动mysqld
首先在docker中安装mysql server的包: sudo yum install mysql sudo yum install mariadb-server mariadb /usr/libe ...
- Linux 磁盘空间查询&&解决Linux 中“磁盘空间不足”的问题
一.linux 查看目录的剩余空间大小 两个命令df .du结合比较直观 df -h 查看整台服务器的硬盘使用情况 du -lh --max-depth=1 : 查看当前目录下一级子文件和子目录占用的 ...
- Docker 中的网络功能介绍 外部访问容器 容器互联 配置 DNS
Docker 中的网络功能介绍 | Docker 从入门到实践 https://vuepress.mirror.docker-practice.com/network/ Docker 允许通过外部访问 ...
- 转载 DNS查询流程简介
转载请注明出处:http://blog.csdn.net/luotuo44/article/details/45545059 DNS(domain name system),读者们或多或少都听过,就是 ...
随机推荐
- java 验证身份证号
- 7-Highcharts曲线图之分辨带
<!DOCTYPE> <html lang='en'> <head> <title>7-Highcharts曲线图之分辨带</title> ...
- vs2008 添加与修改模板.
添加 我的模板: 路径: C:\Users\Administrator\Documents\Visual Studio 2008\Templates\ItemTemplates\Visual C# ...
- HDU1014Uniform Generator
Uniform Generator Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u ...
- Spring中自动装配(转)
Spring中有四种自动装配类型,分别为:byName,byType,constructor,autodetect,下面来分别介绍一下这些是如何自动装配的 <bean id="foo& ...
- associated 2 maps
<!DOCTYPE html><html> <head> <meta http-equiv="Content-Type" content= ...
- .NET中JSON的序列化和反序列化
.NET 中有两种方法进行JSON的操作分别需要引用不同的命名空间 1.System.Runtime.Serialization.Json(System.Runtime.Serialization.d ...
- 通过HTML条件注释判断IE版本的HTML语句详解<!--[if IE]> <![endif]-->
我们常常会在网页的HTML里面看到形如[if lte IE 9]……[endif]的代码,表示的是限定某些浏览器版本才能执行的语句,那么这些判断语句的规则是什么呢?请看下文: <!--[if ! ...
- oracle OVER(PARTITION BY) 函数
OVER(PARTITION BY)函数介绍 开窗函数 Oracle从8.1.6开始提供分析函数,分析函数用于计算基于组的某种聚合值,它和聚合函数的不同之处是:对于每个组返 ...
- Sqli-labs less 27a
Less-27a 本关与27关的区别在于对于id的处理,这里用的是 " ,同时mysql的错误不会在前端页面显示. 我们根据27关直接给出一个示例payload: http://127.0. ...