V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
Kenshiro
V2EX  ›  路由器

请教下华硕 ac86u 原版梅林设定 Hosts 和配置屏蔽规则的方法

  •  
  •   Kenshiro · Oct 18, 2023 · 1469 views
    This topic created in 924 days ago, the information mentioned may be changed or developed.
    华硕自带的网站屏蔽麻烦且时而抽风,求一个插件或者能永久直接修改 Hosts 文件的方法,懂得 V 友们请进。
    4 replies    2023-11-25 11:19:00 +08:00
    drdre
        1
    drdre  
       Oct 18, 2023
    不会谷歌搜索一下吗?原版要 ssh 修改
    Kenshiro
        2
    Kenshiro  
    OP
       Oct 19, 2023 via iPhone
    @drdre 都是非永久修改,每次重启得手动丢
    Brainos
        3
    Brainos  
       Oct 21, 2023   ❤️ 1
    参考 https://github.com/RMerl/asuswrt-merlin.ng/wiki/Custom-config-files#postconf-scriptshttps://github.com/RMerl/asuswrt-merlin.ng/wiki/Custom-domains-with-dnsmasq

    我建议使用一种更安全的方法,创建`/jffs/scripts/dnsmasq.postconf`文件并`chmod 755 /jffs/scripts/dnsmasq.postconf`,内容为:
    ```shell
    #!/bin/sh
    source /usr/sbin/helper.sh

    sed -i '1,$d' /tmp/resolv.dnsmasq
    pc_append 'addn-hosts=/jffs/configs/dnsmasq.d/hostfilenameyouwant' "/etc/dnsmasq.conf"
    ```

    最后把你想要的 hosts 解析写进`/jffs/configs/dnsmasq.d/hostfilenameyouwant`里
    Kenshiro
        4
    Kenshiro  
    OP
       Nov 25, 2023
    @Brainos 不行,host 还是老样子,求解
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5488 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 43ms · UTC 01:38 · PVG 09:38 · LAX 18:38 · JFK 21:38
    ♥ Do have faith in what you're doing.