Block IPv6 DNS result for specific domain

Hi,

unfortunately, my ISP only hands out IPv4 addresses only and does not support IPv6 in this configuration (bridged cable modem). I'm using the HE.net tunnel broker service, which works fine. However, I'm facing a problem with my work (!) Microsoft account: They seem to block logins by country, and now MS thinks that I'm logging in from the US since my system seems to prefer IPv6.

While this could potentially be solved on the client side, I'd very much prefer a network-wide solution that forces Microsoft logins through IPv4.

Is there a way to filter DNS results and remove IPv6 results for specific domains? Very much like here but actually implemented and for some domains only.

If there is no built-in way, does anyone know if/which DNS resolver supports that? I can easily set it up in an LXC container on OpenWrt.

Thanks

Edit: Next time, I'll do a search for "dnsmasq" instead of "OpenWrt" before posting! This seems to be the way to go: https://gist.github.com/jamesmacwhite/6a642cb6bad00c5cefa91ec3d742e2a6

DNSMasq let you filter AAAA records, will see if I can find the right setting

Edit it should be:
--filter-AAAA

So try to add:

filter-AAAA

in /etc/dnsmasq.conf

Edit 2:
there is even an option for it /etc/config/dhcp > dnsmasq:

    option filter_aaaa '0'

Yes, I know, but that filters all IPv6 records. I need to block only specific domains.

I'll try the dnsmasq-based options that I linked in the OP first.

True, for just a specific domain try this:

address=/microsoft.com/:: 

might block AAAA record for that specific domain (I hope)

This seems to work, now i just need to figure out which domains/subdomains to block...

1 Like