Ubuntu服务器16.04.04
dnsmasq.conf:
listen-address = 192.168.5.5, 172.30.108.1, 127.0.0.1
log-queries
resolv-file = /etc/resolv.dnsmasq/etc/rupv.dnsmasq:
nameserver = 8.8.8.8/etc/resv.conf:
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.0.1ps aux grep dns
dnsmasq 13099 0.0 0.0 52864 400 ? S 17:16 0:00 /usr/sbin/dnsmasq -x /var/run/dnsmasq/dnsmasq.pid -u dnsmasq -7 /etc/dnsmasq.d,.dpkg-dist,.dpkg-old,.dpkg-new --local-service --trust-anchor=.,19036,8,2,49AAC11D7B6F6446702E54A1607371607A1A41855200FD2CE1CDDE32F24E8FB5本地防火墙关闭:
sudo ufw status
Status: inactivedig cisco.com
; <<>> DiG 9.10.3-P4-Ubuntu <<>> cisco.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: REFUSED, id: 51709
;; flags: qr rd ra ad; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;cisco.com. IN A
;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Sun Apr 15 17:26:05 CEST 2018
;; MSG SIZE rcvd: 27对于此挖掘,syslog中相应的条目:
dnsmasq[13099]: query[A] cisco.com from 127.0.0.1我只是不明白为什么我总是被拒绝。
谢谢
发布于 2020-05-21 00:04:08
这是为我准备的:
在我的dnsmasq.conf文件中,文件中没有server=指令。我不得不添加到我的ISP上游DNS服务器ip,重新启动dnsmasq,它运行良好。
发布于 2020-03-30 21:00:51
此操作失败的原因是/etc/resolv.dnsmasq的条目无效。它不能包含等号符号(=)。
echo 'nameserver = 8.8.8.8' >/etc/resolv.dnsmasq
systemctl restart dnsmasq
dig @localhost bbc.co.uk | grep -Ew 'status|A'
;; ->>HEADER<<- opcode: QUERY, status: REFUSED, id: 29172
;bbc.co.uk. IN Aecho 'nameserver 8.8.8.8' >/etc/resolv.dnsmasq
systemctl restart dnsmasq
dig @localhost bbc.co.uk | grep -Ew 'status|A'
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 52524
;bbc.co.uk. IN A
bbc.co.uk. 95 IN A 151.101.192.81
bbc.co.uk. 95 IN A 151.101.64.81
bbc.co.uk. 95 IN A 151.101.0.81
bbc.co.uk. 95 IN A 151.101.128.81至于为什么要在早期版本的Ubuntu和Debian (拉伸版)上工作,但是在最近的版本(比如Debian (Buster) )上失败了呢?我不知道,也许语法被收紧了,所以它必须正确。
发布于 2020-03-31 23:24:34
我对这些问题的回答,对我来说是可行的:
chmod 755 /这解决了我所有的问题,我的描述,我的删除评论。我的根目录的权限是,0700,在我看来,这阻止了dnsmasq用户将其进程更改为,以正确操作。
另一个好主意是找出dnsmasq的用户主目录中的权限是否正确。在我的系统中,dnsmasq是那个用户,所以命令:
cat /etc/passwd | grep dnsmasq
dnsmasq:x:110:65534:dnsmasq,,,:/var/lib/misc:/usr/sbin/nologin它将向我展示那个用户的主dir (在我的例子中是/var/lib/misc)
PS:我昨天发表了一些评论(比如帖子,因为我的名声还不够),关于这个帖子中的两个成员宣称他们解决了问题,忽略了‘你怎么解决,你的问题?’被其他用户删除,但被管理员删除,所以我不再重复。
https://unix.stackexchange.com/questions/437907
复制相似问题