Solved

DNS - Using dig to query for CNAME records?

Posted on 2014-09-12
10
15,071 Views
Last Modified: 2014-09-15
What's the dig syntax to query for CNAME records?

What I've tried:
Pro DNS and BIND by Ron Aitchison ch9 DNS Diagnostics and Tools
dig @ns.mydomain.org domain.org any
dig @ns.mydomain.org domain.org cname
dig -t CNAME @ns.mydomain.org domain.org
dig @ns.mydomain.org domain.org

Google searches for the syntax.

https://support.google.com/a/answer/93595?hl=en
Troubleshoot CNAME records

Third party website
http://mxtoolbox.com/CNAMELookup.aspx

We've had CNAMES setup for a long time and we know they work.  Typical email use of CNAMES for example.
0
Comment
Question by:mobot
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 29

Expert Comment

by:becraig
ID: 40320246
Syntax would be
dig domain.com CNAME (optional) <dnsserver>

The tools you specified above are also on the right track, what specifically are you trying to find ?
0
 
LVL 37

Expert Comment

by:Gerwin Jansen
ID: 40320267
dig @8.8.8.8 experts-exchange.com C

(using google's DNS server to lookup the CNAME record for this site)
0
 
LVL 61

Expert Comment

by:gheist
ID: 40322002
CNAME cannot be used with email.
0
 
LVL 37

Expert Comment

by:Gerwin Jansen
ID: 40322039
@mobot - I'm not sure what you mean by "Typical email use of CNAMES for example." - your question is about querying C name records using dig, right?
0
 
LVL 29

Expert Comment

by:becraig
ID: 40322044
I also assume that is the question, if you are asking how cnames are used in email here is your answer:

    MX and NS records must never point to a CNAME alias (RFC 2181 section 10.3). So, for example, a zone must not contain constructs such as:

example.com.      MX     0   foo.example.com.
foo.example.com.  CNAME  host.example.com.
host.example.com. A      192.0.2.1

    Domains that are used for e-mail may not have a CNAME record.[3] In practice this may work, but can have different behavior with different mail servers, and can have undesired effects.[4]

Reference:
http://en.wikipedia.org/wiki/CNAME_record
0
Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

 

Author Comment

by:mobot
ID: 40323802
Sorry not to have been clear.    We have an Outlook web server in play. And we use a CNAME for it so the users don't have to remember the mail server name..
email IN CNAME mailserver.mydomain.org.
And in practice this does work.

I'd like to see something to the similar when using dig.  

C:\>nslookup -q=cname email.mydomain.org nameserver.mydomain.org
Server:  nameserver.mydomain.org
Address:  xxx.xxx.xxx.xxx

email.mydomain.org canonical name = mailserver.mydomain.org
mydomain.org       nameserver = ns3.secondary_dns.net
mydomain.org       nameserver = ns1.secondary_dns.net
mydomain.org       nameserver = ns2.secondary_dns.net
mydomain.org       nameserver = nameserver.mydomain.org
nameserver.mydomain.org    internet address = xxx.xxx.xxx.xxx

C:\>

@Gerwin - what output do you get from running this cmd???  And I am asking how to query for CNAME records.

C:\>dig @8.8.8.8 experts-exchange.com C
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 1748
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;experts-exchange.com.          IN      A

;; ANSWER SECTION:
experts-exchange.com.   17495   IN      A       54.86.90.123

;; Query time: 30 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Mon Sep 15 13:14:56 2014
;; MSG SIZE  rcvd: 54


; <<>> DiG 9.3.2 <<>> @8.8.8.8 experts-exchange.com C
; (1 server found)
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 1121
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;C.                             IN      A

;; AUTHORITY SECTION:
.                       1081    IN      SOA     a.root-servers.net. nstld.verisi
gn-grs.com. 2014091500 1800 900 604800 86400

;; Query time: 30 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Mon Sep 15 13:14:56 2014
;; MSG SIZE  rcvd: 94
0
 
LVL 29

Accepted Solution

by:
becraig earned 500 total points
ID: 40323836
This would be the section you are looking for:
Command:
dig  www.experts-exchange.com CNAME


;; ANSWER SECTION:
www.experts-exchange.com. 8653  IN      CNAME   experts-exchange-437318971.us-east-1.elb.amazonaws.com.
0
 

Author Comment

by:mobot
ID: 40323905
I came up with this syntax and it works.  And the last cmd you just sent me works as well.  So either one will do what I want done.

C:\>dig -t cname @ns.mydomain.org email.mydomain.org

; <<>> DiG 9.3.2 <<>> -t cname @ns.mydomain.org email.mydomain.org
; (1 server found)
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 1688
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 4, ADDITIONAL: 1

;; QUESTION SECTION:
;email.mydomain.org.               IN      CNAME

;; ANSWER SECTION:
email.mydomain.org.        43200   IN      CNAME   mailserver.mydomain.org.

;; AUTHORITY SECTION:
mydomain.org.              43200   IN      NS      ns1.secondary_dns.net.
mydomain.org.              43200   IN      NS      ns.mydomain.org.
mydomain.org.              43200   IN      NS      ns3.secondary_dns.net.
mydomain.org.              43200   IN      NS      ns2.secondary_dns.net.

;; ADDITIONAL SECTION:
ns.mydomain.org.   43200   IN      A       xxx.xxx.xxx.xxx

;; Query time: 30 msec
;; SERVER: xxx.xxx.xxx.xxx#53(xxx.xxx.xxx.xxx)
;; WHEN: Mon Sep 15 14:19:42 2014
;; MSG SIZE  rcvd: 161


C:\>
===============================================================================================
C:\>dig www.experts-exchange CNAME

; <<>> DiG 9.3.2 <<>> www.experts-exchange CNAME
;; global options:  printcmd
;; connection timed out; no servers could be reached

C:\>dig @208.67.222.222 www.experts-exchange.com CNAME

; <<>> DiG 9.3.2 <<>> @208.67.222.222 www.experts-exchange.com CNAME
; (1 server found)
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 8
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;www.experts-exchange.com.      IN      CNAME

;; ANSWER SECTION:
www.experts-exchange.com. 83211 IN      CNAME   experts-exchange-437318971.us-ea
st-1.elb.amazonaws.com.

;; Query time: 30 msec
;; SERVER: 208.67.222.222#53(208.67.222.222)
;; WHEN: Mon Sep 15 14:31:45 2014
;; MSG SIZE  rcvd: 107


C:\>
0
 
LVL 29

Expert Comment

by:becraig
ID: 40323917
Great that you got the answer you needed.

Happy to help.
0
 

Author Closing Comment

by:mobot
ID: 40323926
I added the opendns server because of the timeout.  The timeout could be a problem on my end.  But anyway the syntax you sent is what I was asking for.  That section is what I needed to see.  That confirms the CNAME is mapping correctly.  So thanks a bunch.
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
I've written instructions for one router type, but this principle may be useful for others of the same brand and even other brands of router. Problem: I had an issue especially with mobile devices that refused to use DNS information supplied via…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now