Ruby on rails dnsmasq启动但忽略名称服务器-本地接口

Ruby on rails dnsmasq启动但忽略名称服务器-本地接口,ruby-on-rails,dnsmasq,Ruby On Rails,Dnsmasq,我正在Ubuntu上工作。dnsmasq服务成功启动,但它忽略/etc/resolv.conf文件中的nameserver 127.0.0.1 这是/etc/resolv.conf文件 以下是rails服务器在后台运行时的dnsmasq状态输出 dnsmasq.service - dnsmasq - A lightweight DHCP and caching DNS server Loaded: loaded (/lib/systemd/system/dnsmasq.service;

我正在Ubuntu上工作。dnsmasq服务成功启动,但它忽略/etc/resolv.conf文件中的nameserver 127.0.0.1

这是/etc/resolv.conf文件

以下是rails服务器在后台运行时的dnsmasq状态输出

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 Thu 2020-08-06 02:38:47 IST; 9s ago
    Process: 85182 ExecStartPre=/usr/sbin/dnsmasq --test (code=exited, status=0/SUCCESS)
    Process: 85183 ExecStart=/etc/init.d/dnsmasq systemd-exec (code=exited, status=0/SUCCESS)
    Process: 85211 ExecStartPost=/etc/init.d/dnsmasq systemd-start-resolvconf (code=exited, status=0/SUCCESS)
   Main PID: 85210 (dnsmasq)
      Tasks: 1 (limit: 9356)
     Memory: 1.7M
     CGroup: /system.slice/dnsmasq.service
             └─85210 /usr/sbin/dnsmasq -x /run/dnsmasq/dnsmasq.pid -u dnsmasq -7 /etc/dnsmasq.d,.dpkg-dist,.dpkg-old,.dpkg-new --local-servic>

Aug 06 02:38:47 hp-HP-Pavilion-Notebook systemd[1]: Starting dnsmasq - A lightweight DHCP and caching DNS server...
Aug 06 02:38:47 hp-HP-Pavilion-Notebook dnsmasq[85182]: dnsmasq: syntax check OK.
Aug 06 02:38:47 hp-HP-Pavilion-Notebook dnsmasq[85210]: started, version 2.80 cachesize 150
Aug 06 02:38:47 hp-HP-Pavilion-Notebook dnsmasq[85210]: DNS service limited to local subnets
Aug 06 02:38:47 hp-HP-Pavilion-Notebook dnsmasq[85210]: compile time options: IPv6 GNU-getopt DBus i18n IDN DHCP DHCPv6 no-Lua TFTP conntrack>
Aug 06 02:38:47 hp-HP-Pavilion-Notebook dnsmasq[85210]: reading /etc/resolv.conf
Aug 06 02:38:47 hp-HP-Pavilion-Notebook dnsmasq[85210]: ignoring nameserver 127.0.0.1 - local interface
Aug 06 02:38:47 hp-HP-Pavilion-Notebook dnsmasq[85210]: using nameserver 8.8.8.8#53
Aug 06 02:38:47 hp-HP-Pavilion-Notebook dnsmasq[85210]: read /etc/hosts - 7 addresses
Aug 06 02:38:47 hp-HP-Pavilion-Notebook systemd[1]: Started dnsmasq - A lightweight DHCP and caching DNS server.
为什么127.0.0.1 geting上的服务器被忽略?

根据dnsmasq验证上游名称服务器的套接字地址(IP/端口)与其自身的套接字地址(IP/端口)不同


这是一个健全性检查,否则dnsmasq会将查询转发给自身,这可能会导致无限循环。

您能解决这个问题吗?
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 Thu 2020-08-06 02:38:47 IST; 9s ago
    Process: 85182 ExecStartPre=/usr/sbin/dnsmasq --test (code=exited, status=0/SUCCESS)
    Process: 85183 ExecStart=/etc/init.d/dnsmasq systemd-exec (code=exited, status=0/SUCCESS)
    Process: 85211 ExecStartPost=/etc/init.d/dnsmasq systemd-start-resolvconf (code=exited, status=0/SUCCESS)
   Main PID: 85210 (dnsmasq)
      Tasks: 1 (limit: 9356)
     Memory: 1.7M
     CGroup: /system.slice/dnsmasq.service
             └─85210 /usr/sbin/dnsmasq -x /run/dnsmasq/dnsmasq.pid -u dnsmasq -7 /etc/dnsmasq.d,.dpkg-dist,.dpkg-old,.dpkg-new --local-servic>

Aug 06 02:38:47 hp-HP-Pavilion-Notebook systemd[1]: Starting dnsmasq - A lightweight DHCP and caching DNS server...
Aug 06 02:38:47 hp-HP-Pavilion-Notebook dnsmasq[85182]: dnsmasq: syntax check OK.
Aug 06 02:38:47 hp-HP-Pavilion-Notebook dnsmasq[85210]: started, version 2.80 cachesize 150
Aug 06 02:38:47 hp-HP-Pavilion-Notebook dnsmasq[85210]: DNS service limited to local subnets
Aug 06 02:38:47 hp-HP-Pavilion-Notebook dnsmasq[85210]: compile time options: IPv6 GNU-getopt DBus i18n IDN DHCP DHCPv6 no-Lua TFTP conntrack>
Aug 06 02:38:47 hp-HP-Pavilion-Notebook dnsmasq[85210]: reading /etc/resolv.conf
Aug 06 02:38:47 hp-HP-Pavilion-Notebook dnsmasq[85210]: ignoring nameserver 127.0.0.1 - local interface
Aug 06 02:38:47 hp-HP-Pavilion-Notebook dnsmasq[85210]: using nameserver 8.8.8.8#53
Aug 06 02:38:47 hp-HP-Pavilion-Notebook dnsmasq[85210]: read /etc/hosts - 7 addresses
Aug 06 02:38:47 hp-HP-Pavilion-Notebook systemd[1]: Started dnsmasq - A lightweight DHCP and caching DNS server.