Jan 16 02:49:30 ubuntu systemd[1]: Starting dnsmasq - A lightweight DHCP and caching DNS server... Jan 16 02:49:30 ubuntu dnsmasq[1570]: dnsmasq: syntax check OK. Jan 16 02:49:31 ubuntu dnsmasq[1571]: dnsmasq: failed to create listening socket for port 53: Address already in use Jan 16 02:49:31 ubuntu dnsmasq[1571]: failed to create listening socket for port 53: Address already in use Jan 16 02:49:31 ubuntu dnsmasq[1571]: FAILED to start up Jan 16 02:49:31 ubuntu systemd[1]: dnsmasq.service: Control process exited, code=exited, status=2/INVALIDARGUMENT Jan 16 02:49:31 ubuntu systemd[1]: dnsmasq.service: Failed with result 'exit-code'. Jan 16 02:49:31 ubuntu systemd[1]: Failed to start dnsmasq - A lightweight DHCP and caching DNS server.
重启dnsmasq服务
1
sudo systemctl restart dnsmasq
正确运行后执行sudo systemctl status dnsmasq输出应该大致如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
● dnsmasq.service - dnsmasq - A lightweight DHCP and caching DNS server Loaded: loaded (/lib/systemd/system/dnsmasq.service; enabled; vendor preset: enabled) Active: active (running) since Mon 2023-01-16 02:51:26 UTC; 1min 0s ago Process: 1606 ExecStartPre=/usr/sbin/dnsmasq --test (code=exited, status=0/SUCCESS) Process: 1607 ExecStart=/etc/init.d/dnsmasq systemd-exec (code=exited, status=0/SUCCESS) Process: 1616 ExecStartPost=/etc/init.d/dnsmasq systemd-start-resolvconf (code=exited, status=0/SUCCESS) Main PID: 1615 (dnsmasq) Tasks: 1 (limit: 4433) CGroup: /system.slice/dnsmasq.service └─1615 /usr/sbin/dnsmasq -x /run/dnsmasq/dnsmasq.pid -u dnsmasq -7 /etc/dnsmasq.d,.dpkg-dist,.dpkg-old,.dp>
Jan 16 02:51:25 ubuntu systemd[1]: Starting dnsmasq - A lightweight DHCP and caching DNS server... Jan 16 02:51:25 ubuntu dnsmasq[1606]: dnsmasq: syntax check OK. Jan 16 02:51:26 ubuntu dnsmasq[1615]: started, version 2.80 DNS disabled Jan 16 02:51:26 ubuntu dnsmasq[1615]: compile time options: IPv6 GNU-getopt DBus i18n IDN DHCP DHCPv6 no-Lua TFTP connt> Jan 16 02:51:26 ubuntu dnsmasq-dhcp[1615]: DHCP, IP range 172.21.252.2 -- 172.21.252.254, lease time 12h Jan 16 02:51:26 ubuntu systemd[1]: Started dnsmasq - A lightweight DHCP and caching DNS server. lines 1-17/17 (END)