使用SSH登陆路由器,在【/jffs/configs】下建立【dnsmasq.conf.add】文件,文件内容为 addn-hosts=/jffs/configs/hosts
重启服务 killall -SIGHUP dnsmasq
dnsmasq.conf.add消失了
看到系统日志读取了hosts
- May 10 23:37:25 dnsmasq[2374]: read /etc/hosts - 59 names
复制代码
但是 bbs.binmt.cc依然可以访问 
host内容
- # Title: StevenBlack/hosts
- #
- # This hosts file is a merged collection of hosts from reputable sources,
- # with a dash of crowd sourcing via GitHub
- #
- # Date: 04 May 2024 02:31:28 (UTC)
- # Number of unique domains: 128,270
- #
- # Fetch the latest version of this file: https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
- # Project home page: https://github.com/StevenBlack/hosts
- # Project releases: https://github.com/StevenBlack/hosts/releases
- #
- # ===============================================================
- 127.0.0.1 localhost
- 127.0.0.1 localhost.localdomain
- 127.0.0.1 local
- 255.255.255.255 broadcasthost
- ::1 localhost
- ::1 ip6-localhost
- ::1 ip6-loopback
- ff00::0 ip6-localnet
- ff00::0 ip6-mcastprefix
- ff02::1 ip6-allnodes
- ff02::2 ip6-allrouters
- ff02::3 ip6-allhosts
- 0.0.0.0 0.0.0.0
- # Custom host records are listed here.
- # End of custom host records.
- # Start StevenBlack
- #=====================================
- # Title: Hosts contributed by Steven Black
- # http://stevenblack.com
- 127.0.0.1 f12.baidu.com
- 127.0.0.1 t-dsp.pinduoduo.com
- 127.0.0.1 luimg.baidu.com
- 127.0.0.1 wn.pos.baidu.com
- 127.0.0.1 mobads.baidu.com
- 127.0.0.1 ulogs.umeng.com
- 127.0.0.1 ulogs.umengcloud.com
- 127.0.0.1 ios.bugly.com
- 127.0.0.1 showapi.babybus.com
- 127.0.0.1 union.baidu.com
- 127.0.0.1 two.fsylr.com
- 127.0.0.1 arms-retcode.aliyuncs.com
- 127.0.0.1 ott.da.mgtv.com
- 127.0.0.1 ys.da.mgtv.com
- 127.0.0.1 img.da.mgtv.com
- 127.0.0.1 luimg.baidu.com
- 127.0.0.1 wn.pos.baidu.com
- 127.0.0.1 mobads.baidu.com
- 127.0.0.1 ulogs.umeng.com
- 127.0.0.1 ulogs.umengcloud.com
- 127.0.0.1 ios.bugly.com
- 127.0.0.1 showapi.babybus.com
- 127.0.0.1 hm.baidu.com
- 127.0.0.1 mbd.baidu.com
- 127.0.0.1 erebor.douban.com
- 127.0.0.1 googletagmanager.com
- 127.0.0.1 googlesyndication.com
- 127.0.0.1 at3.doubanio.com
- 127.0.0.1 mbd.baidu.com
- 127.0.0.1 f12.baidu.com
- 127.0.0.1 t-dsp.pinduoduo.com
- 127.0.0.1 luimg.baidu.com
- 127.0.0.1 wn.pos.baidu.com
- 127.0.0.1 mobads.baidu.com
- 127.0.0.1 ulogs.umeng.com
- 127.0.0.1 ulogs.umengcloud.com
- 127.0.0.1 ios.bugly.com
- 127.0.0.1 showapi.babybus.com
- 127.0.0.1 hm.baidu.com
- 127.0.0.1 mbd.baidu.com
- 127.0.0.1 erebor.douban.com
- 127.0.0.1 googletagmanager.com
- 127.0.0.1 googlesyndication.com
- 127.0.0.1 at3.doubanio.com
- 127.0.0.1 mbd.baidu.com
- 127.0.0.1 bbs.binmt.cc
复制代码
其他日志
- May 10 23:37:25 dnsmasq[2374]: read /etc/hosts - 59 names
- May 10 23:37:50 klcb2010: ⌚23:37:50 ...
- May 10 23:37:51 rc_service: service 9365:notify_rc restart_dnsmasq
- May 10 23:37:51 dnsmasq[2374]: exiting on receipt of SIGTERM
- May 10 23:37:51 custom_config: Using custom /jffs/configs/hosts config file.
- May 10 23:37:51 dnsmasq[9373]: started, version 2.89 cachesize 1500
- May 10 23:37:51 dnsmasq[9373]: compile time options: IPv6 GNU-getopt no-RTC no-DBus no-UBus no-i18n no-IDN DHCP DHCPv6 no-Lua TFTP no-conntrack ipset no-nftset no-auth cryptohash DNSSEC no-ID loop-detect no-inotify no-dumpfile
- May 10 23:37:51 dnsmasq[9373]: warning: interface br2 does not currently exist
- May 10 23:37:51 dnsmasq[9373]: warning: interface br1 does not currently exist
- May 10 23:37:51 dnsmasq[9373]: warning: interface pptp* does not currently exist
- May 10 23:37:51 dnsmasq[9373]: asynchronous logging enabled, queue limit is 5 messages
- May 10 23:37:51 dnsmasq-dhcp[9373]: DHCP, IP range 192.168.102.2 -- 192.168.102.254, lease time 1d
- May 10 23:37:51 dnsmasq-dhcp[9373]: DHCP, IP range 192.168.101.2 -- 192.168.101.254, lease time 1d
- May 10 23:37:51 dnsmasq-dhcp[9373]: DHCP, IP range 192.168.50.2 -- 192.168.50.254, lease time 1d
- May 10 23:37:51 dnsmasq-dhcp[9373]: DHCPv6 stateless on br0
- May 10 23:37:51 dnsmasq-dhcp[9373]: router advertisement on br0
- May 10 23:37:51 dnsmasq-dhcp[9373]: DHCPv6 stateless on 240e:338:261:26d1::, constructed for br0
- May 10 23:37:51 dnsmasq-dhcp[9373]: router advertisement on 240e:338:261:26d1::, constructed for br0
- May 10 23:37:51 dnsmasq-dhcp[9373]: IPv6 router advertisement enabled
- May 10 23:37:51 dnsmasq[9373]: read /etc/hosts - 59 names
- May 10 23:37:51 dnsmasq[9373]: using nameserver 192.168.1.1#53
- May 10 23:37:51 dnsmasq[9373]: using nameserver fe80::1#53
- May 10 23:37:51 dnsmasq[9373]: using nameserver 192.168.1.1#53
- May 10 23:37:51 dnsmasq[9373]: using nameserver fe80::1#53
- May 10 23:37:55 ss-redir[11062]: initializing ciphers... chacha20-ietf-poly1305
- May 10 23:37:55 ss-redir[11062]: listening at 0.0.0.0:3333
- May 10 23:37:55 ss-redir[11061]: initializing ciphers... chacha20-ietf-poly1305
- May 10 23:37:55 ss-redir[11062]: tcp port reuse enabled
- May 10 23:37:55 ss-redir[11062]: UDP relay enabled
- May 10 23:37:55 ss-redir[11062]: udp port reuse enabled
- May 10 23:37:55 ss-redir[11061]: listening at 0.0.0.0:3333
- May 10 23:37:55 ss-redir[11062]: running from root user
- May 10 23:37:55 ss-redir[11061]: tcp port reuse enabled
- May 10 23:37:55 ss-redir[11061]: UDP relay enabled
- May 10 23:37:55 ss-redir[11061]: udp port reuse enabled
- May 10 23:37:55 ss-redir[11061]: running from root user
- May 10 23:37:55 ss-redir[11064]: initializing ciphers... chacha20-ietf-poly1305
- May 10 23:37:55 ss-redir[11064]: listening at 0.0.0.0:3333
- May 10 23:37:55 ss-redir[11064]: tcp port reuse enabled
- May 10 23:37:55 ss-redir[11064]: UDP relay enabled
- May 10 23:37:55 ss-redir[11064]: udp port reuse enabled
- May 10 23:37:55 ss-redir[11064]: running from root user
- May 10 23:37:55 ss-redir[11075]: initializing ciphers... chacha20-ietf-poly1305
- May 10 23:37:55 ss-redir[11075]: listening at 0.0.0.0:3333
- May 10 23:37:55 ss-redir[11075]: tcp port reuse enabled
- May 10 23:37:55 ss-redir[11075]: UDP relay enabled
- May 10 23:37:55 ss-redir[11075]: udp port reuse enabled
- May 10 23:37:55 ss-redir[11075]: running from root user
- May 10 23:37:56 ss-local[11278]: initializing ciphers... chacha20-ietf-poly1305
- May 10 23:37:56 ss-local[11278]: listening at 0.0.0.0:23456
- May 10 23:37:56 ss-local[11278]: udprelay enabled
- May 10 23:37:56 ss-local[11278]: running from root user
- May 10 23:37:57 rc_service: service 11643:notify_rc restart_dnsmasq
- May 10 23:37:57 dnsmasq[9373]: exiting on receipt of SIGTERM
- May 10 23:37:57 custom_config: Using custom /jffs/configs/hosts config file.
- May 10 23:37:57 custom_script: Running /jffs/scripts/dnsmasq.postconf (args: /etc/dnsmasq.conf)
- May 10 23:37:58 dnsmasq[11958]: started, version 2.89 cachesize 9999
- May 10 23:37:58 dnsmasq[11958]: compile time options: IPv6 GNU-getopt no-RTC no-DBus no-UBus no-i18n no-IDN DHCP DHCPv6 no-Lua TFTP no-conntrack ipset no-nftset no-auth cryptohash DNSSEC no-ID loop-detect no-inotify no-dumpfile
- May 10 23:37:58 dnsmasq[11958]: warning: interface br2 does not currently exist
- May 10 23:37:58 dnsmasq[11958]: warning: interface br1 does not currently exist
- May 10 23:37:58 dnsmasq[11958]: warning: interface pptp* does not currently exist
- May 10 23:37:58 dnsmasq[11958]: asynchronous logging enabled, queue limit is 5 messages
- May 10 23:37:58 dnsmasq-dhcp[11958]: DHCP, IP range 192.168.102.2 -- 192.168.102.254, lease time 1d
- May 10 23:37:58 dnsmasq-dhcp[11958]: DHCP, IP range 192.168.101.2 -- 192.168.101.254, lease time 1d
- May 10 23:37:58 dnsmasq-dhcp[11958]: DHCP, IP range 192.168.50.2 -- 192.168.50.254, lease time 1d
- May 10 23:37:58 dnsmasq-dhcp[11958]: DHCPv6 stateless on br0
- May 10 23:37:58 dnsmasq-dhcp[11958]: router advertisement on br0
- May 10 23:37:58 dnsmasq-dhcp[11958]: DHCPv6 stateless on 240e:338:261:26d1::, constructed for br0
- May 10 23:37:58 dnsmasq-dhcp[11958]: router advertisement on 240e:338:261:26d1::, constructed for br0
- May 10 23:37:58 dnsmasq-dhcp[11958]: IPv6 router advertisement enabled
- May 10 23:37:58 dnsmasq[11958]: using nameserver 127.0.0.1#7913
- May 10 23:37:58 dnsmasq[11958]: read /etc/hosts - 59 names
复制代码
|