The dig tool does not support Google edns by default. By patching, dig supports + client query, such as the following code:
#下载bind包
wget ftp://ftp.isc.org/isc/bind9/9.9.9/bind-9.9.9.tar.gz
tar xf bind-9.9.3.tar.gz
cd bind-9.9.9
#从Wilmer van der Gaast下载补丁.
wget https://wilmer.gaa.st/edns-client-subnet/bind-9.9.3-dig-edns-client-subnet-iana.diff
#Patch the code, configure (without OpenSSL because we only want dig) and compile.
patch -p0 < bind-9.9.3-
dig
-edns-client-subnet-iana.
diff
./configure --without-openssl
make
In the bind-9.9.9 / bin / dig directory, you can find the compiled dig binary tool!
[root@localhost dig]# pwd
/usr/local/src/bind-9.9.9/bin/dig
Copy the compiled dig binary command to the / usr / bin directory to replace the original old version
mv /usr/bin/dig /usr/bin/dig.bak
cp /usr/local/src/bind-9.9.9/bin/dig/dig /usr/bin/