问题原文
原帖链接 · Ole Wolf · CC BY-SA 3.0
I've setup a caching DNS server with bind9 using a root-hints method (like this). It works as desired--but, our IPv6 traffic goes through a gateway outside of my country that makes Netflix think we're visiting from that other country, and this prevents my kids from watching their favorite shows. So I'm thinking that if I can prevent bind9 from returning any AAAA records for netflix.com, the clients will only attempt IPv4 connections to Netflix.
That is: how do I configure bind9 so that AAAA record look-ups for netflix.com are suppressed while valid A record results are returned for netflix.com?
I realize I can create a zone file with just the Netflix domain and have it contain all of the A records for netflix.com that I can find and no AAAA records. But I'm wondering if maybe the above is possible so I don't have to keep the A records in the zone file updated.
社区高分解答
原帖链接 · Bob · CC BY-SA 4.0
I know this is an old post, but (at least) in my version of bind (9.11 on Ubuntu 18.04) I discovered that you can use filter-aaaa-on-v4 combined with match-destinations in a view.
It still requires you to have bind listening on 2 ip adresses, but at least you don't need multiple instances.
192.168.1.1 is the normal dns server. 192.168.1.2 is the ipv6 blocking one.
My config looks kind of like this (partial):
options {
listen-on port 53 { 192.168.1.1; };
listen-on port 5353 { 192.168.1.2; };
};
view "ipv4only" {
match-destinations { 192.168.1.2/24; };
filter-aaaa-on-v4 yes;
};
view "normal" {
match-clients { 192.168.1.1/24; };
zone "netflix.com" {
type forward;
forward only;
forwarders { 192.168.1.2 port 5353; };
};
};
That makes bind do a forward lookup to itself on another ip, when the domain matches netflix.com.
This eliminates the need for two instances, but sadly requires 2 internal ip adresses. It would be nice if we also could specify a port number in "match-destinations".
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
