glibc 2.31 strips the AD flag, unless either the application specifies
RES_TRUSTAD or the options in resolv.conf contain trust-ad.
See https://sourceware.org/git/?p=glibc.git;a=blob_plain;f=NEWS;hb=HEAD
(cherry picked from commit
a742f9828ea73d9c2c9bafe701c10fe60f058012)
# operation for /etc/resolv.conf.
nameserver 127.0.0.53
-options edns0
+options edns0 trust-ad
"# operation for /etc/resolv.conf.\n"
"\n"
"nameserver 127.0.0.53\n"
- "options edns0\n", f);
+ "options edns0 trust-ad\n", f);
if (!ordered_set_isempty(domains))
write_resolv_conf_search(domains, f);