How to query authoritative dns server in java to get txt records instantly

1k Views Asked by At

I am trying to validate txt records in the dns in order to verify if a domain is owned by an entity. To do this I will ask the domain owner to add a txt record I provide. After they make the change I need to instantly check whether the txt value is present. I believe I can do that in case I lookup the authoritative name server for the domain.

Is there a way in java to query txt records for a domain from the authoritative name server.

Example:

1.There is domain xyz.com with authoritative name server a1.abc.com

2.a txt record is added to xyz.com

3.I do not know the authoritative name server, so I query xyz.com to get authoritative response from the authoritative name server - is there a java library that can do that?

I believe dnsjava implements the dns protocol but I do not find a way to query the authoritative name server

0

There are 0 best solutions below