bind9(递归)配置 ECS 不生效 - V2EX
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
kincaid

bind9(递归)配置 ECS 不生效

  •  
  •   kincaid
    PRO
    2022 年 3 月 23 日 1547 次点击
    这是一个创建于 1493 天前的主题,其中的信息可能已经有所发展或是发生改变。

    最近在学习 dns 的相关知识,然后尝试用 bind 在内网搭建了一个递归 dns ,测试了一下解析什么的都正常,但是 ECS 似乎并不起作用,有大佬遇到过类似的情况嘛? bind9.16.x 和 bind9.18.x 都试过了

    测试结果

    dig www.taobao.com @127.0.0.1 -p 54 +subnet=202.96.64.68 ; <<>> DiG 9.18.1-1+0~2022016.73+debian11~1.gbp965910-Debian <<>> www.taobao.com @127.0.0.1 -p 54 +subnet=202.96.64.68 ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 33865 ;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 1 ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 1232 ; COOKIE: 5abbcad304b5d31c01000000623aaad500ab63c28430b13f (good) ; CLIENT-SUBNET: 202.96.64.68/32/0 ;; QUESTION SECTION: ;www.taobao.com. IN A ;; ANSWER SECTION: www.taobao.com. 600 IN CNAME www.taobao.com.danuoyi.tbcache.com. www.taobao.com.danuoyi.tbcache.com. 60 IN A 36.147.19.230 www.taobao.com.danuoyi.tbcache.com. 60 IN A 36.147.19.231 ;; Query time: 956 msec ;; SERVER: 127.0.0.1#54(127.0.0.1) (UDP) ;; WHEN: Wed Mar 23 13:06:29 CST 2022 ;; MSG SIZE rcvd: 163 

    传了辽宁联通的 IP ,但返回仍是宽带出口 IP 查询的结果

    配置文件

    named.conf

    // This is the primary configuration file for the BIND DNS server named. // // Please read /usr/share/doc/bind9/README.Debian.gz for information on the // structure of BIND configuration files in Debian, *BEFORE* you customize // this configuration file. // // If you are just adding zones, please do that in /etc/bind/named.conf.local include "/etc/bind/named.conf.options"; include "/etc/bind/named.conf.local"; include "/etc/bind/named.conf.default-zones"; 

    named.conf.local

    // // Do any local configuration here // // Consider adding the 1918 zones here, if they are not used in your // organization //include "/etc/bind/zones.rfc1918"; 

    named.conf.options

    options { directory "/var/cache/bind"; // If there is a firewall between you and nameservers you want // to talk to, you may need to fix the firewall to allow multiple // ports to talk. See http://www.kb.cert.org/vuls/id/800113 // If your ISP provided one or more IP addresses for stable // nameservers, you probably want to use them as forwarders. // Uncomment the following block, and insert the addresses replacing // the all-0's placeholder. // forwarders { // 0.0.0.0; // }; //======================================================================== // If BIND logs error messages about the root key being expired, // you will need to update your keys. See https://www.isc.org/bind-keys //======================================================================== dnssec-validation yes; listen-on port 54 { any; }; listen-on-v6 port 54 { any; }; }; 

    named.conf.default-zones

    // prime the server with knowledge of the root servers zone "." { type hint; file "/usr/share/dns/root.hints"; }; // be authoritative for the localhost forward and reverse zones, and for // broadcast zones as per RFC 1912 zone "localhost" { type master; file "/etc/bind/db.local"; }; zone "127.in-addr.arpa" { type master; file "/etc/bind/db.127"; }; zone "0.in-addr.arpa" { type master; file "/etc/bind/db.0"; }; zone "255.in-addr.arpa" { type master; file "/etc/bind/db.255"; }; zone "in-addr.arpa" { type master; file "/etc/bind/in-addr.arpa"; }; zone "root.zone" { type master; file "/etc/bind/root.zone"; }; 

    求各位大佬指教

    kincaid
        1
    kincaid  
    OP
    PRO
       2022 年 3 月 23 日
    看起来是 CLIENT-SUBNET 后面 /0 导致的,但是不清楚为什么会带上这个,试了 Powerdns 也会带这个
    关于     帮助文档     自助推广系统     博客     API     FAQ     Solana     893 人在线   最高记录 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 47ms UTC 21:42 PVG 05:42 LAX 14:42 JFK 17:42
    Do have faith in what you're doing.
    ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86