Query a specific DNS record type associated with a given domain name

dig

dig +short {{example.com}} {{A|MX|TXT|CNAME|NS}}

click the source code to copy install dig on any operating system with command-not-found.com