Not able to retrieve DNS TXT record for DKIM public key
I'm trying to sign an outgoing email with DKIM in Azure Linux virtual machine, but I'm not able to fetch DKIM record from DNS records of my domain.
I have tested with the following command and I'm able to fetch SPF record without any issues
$ dig mydomain.com TXT
;; -HEADER- opcode: QUERY, status: NOERROR
;; QUESTION SECTION:
;mydomain.com. IN TXT
;; ANSWER SECTION:
mydomain.com. 1800 IN TXT "v=spf1 ip4:xxx.xxx.xxx.xxx ~all"
but when i try to fetch DKIM record its not working, i tried with following command
$ dig mailselector._domainkey.mydomain.com TXT
;; -HEADER;- opcode: QUERY, status: SERVFAIL
;; QUESTION SECTION:
;mailselector._domainkey.mydomain.com. IN TXT
above command take a bit of time to execute and unlike the previous command, there is no ANSWER SECTION in the output
if use the same command in my system I'm getting DKIM record successfully without any delay, the following is output from my system
$ dig mailselector._domainkey.mydomain.com TXT
;; -HEADER- opcode: QUERY, status: NOERROR
;; QUESTION SECTION:
;mailselector._domainkey.mydomain.com. IN TXT
;; ANSWER SECTION:
mailselector._domainkey.mydomain.com. 600 IN TXT "v=DKIM1; k=rsa; p=<COMPLETE PUBLIC KEY>"
==============UPDATE==========
i tried changing the values and mailselector and what i found is, if the value is small i am able to retrive the value without any issue but as soon as i change the value back to DKIM key, i'm getting timeout