angelfish 发表于 2022-10-21 20:15

请问Pihole的问题!!



如题:我在虚拟机里装了个UBUNTU, 但是出现错误,是什么53端口被USED, 请问这个怎么解决??


谢谢!!


gnattu 发表于 2022-10-21 20:26

Ubuntu默认使用的systemd-resolved会在127.0.01:53端口开个stub,我没记错的话你把pi-hole监听地址从0.0.0.0改到它自己的ip地址就行了,实在不行的时候再把这个stub关掉

EchoIsland 发表于 2022-10-21 20:29

ubuntu默认53端口被systemd-resolved占用了,关掉就可以了吧,之前我记得笔记复制过来,可以参考一下

Disable and stop the systemd-resolved service:

sudo systemctl disable systemd-resolved
sudo systemctl stop systemd-resolved


Then put the following line in the `` section of your `/etc/NetworkManager/NetworkManager.conf`:

dns=default

change DNS in /etc/resolv.conf`


nameserver 127.0.0.1
nameserver 119.29.29.29

九天御风 发表于 2022-10-22 10:06

感觉虚拟机里装UBUNTU老是有问题,我就是pve里装UBUNTU,然后编译点东西就老是提示连接错误,等待对方重新连接这些,烦死了。

angelfish 发表于 2022-10-22 13:43

gnattu 发表于 2022-10-21 20:26
Ubuntu默认使用的systemd-resolved会在127.0.01:53端口开个stub,我没记错的话你把pi-hole监听地址从0.0.0. ...

把pi-hole监听地址从0.0.0.0改到它自己的ip地址,我UBUNTU的IP是192.168.1.89,你说的监听地址在哪里改?? 谢谢

gnattu 发表于 2022-10-22 18:40

angelfish 发表于 2022-10-22 13:43
把pi-hole监听地址从0.0.0.0改到它自己的ip地址,我UBUNTU的IP是192.168.1.89,你说的监听地址在哪里改??...

现在版本是绑定网卡的,你在Settings里点DNS,然后右边有一个Interface settings,下面红框里有一个Bind only to interface xxx(xxx是你的网卡名字)

angelfish 发表于 2022-10-22 19:42

gnattu 发表于 2022-10-22 18:40
现在版本是绑定网卡的,你在Settings里点DNS,然后右边有一个Interface settings,下面红框里有一个Bind...

好的,懂了,谢谢热心指点,github的MrHousehao/Pi-hole-Chinese竟然还有汉化包不错!!有没有好用的广告的规则,我油管广告去老去不掉[流汗]

aitkots 发表于 2022-10-24 10:30

安装软件包:

## 安装网络工具
$ sudo apt install iperf iperf3 iftop net-tools ethtool


检查系统 53 端口是否有被占用:

$ sudo lsof -i:53

$ sudo netstat -ntulp | grep 53


修改 Ubuntu 默认网卡配置,因为使用自建 dns 服务器,建议使用静态地址,演示为 172.16.1.2 ,ipv4 配置方法如下,ipv6 类似:

$ cat /etc/netplan/00-installer-config.yaml

# This is the network config written by 'subiquity'
network:
ethernets:
    eth0:
      addresses:
      - 172.16.1.2/24
      gateway4: 172.16.1.1
      nameservers:
      addresses:
      - 172.16.1.2
      search:
      - fox.local
version: 2


修改系统 dns 配置文件:

$ cd /etc/systemd/
$ sudo mkdir resolved.conf.d
$ cd resolved.conf.d/
$ sudo nano pihole.conf


填入以下内容:

## Modify System DNS Resolver

DNS=127.0.0.1
DNSStubListener=no


重新软连接系统 dns 配置文件:

$ sudo mv /etc/resolv.conf /etc/resolv.conf.bak
$ sudo ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf


重启 systemd-resolved 服务:
$ sudo systemctl restart systemd-resolved.service

此时 53 端口应该没有被占用了。

angelfish 发表于 2022-10-25 21:53

aitkots 发表于 2022-10-24 10:30
安装软件包:




谢谢!!好详细!!
页: [1]
查看完整版本: 请问Pihole的问题!!