1
Help with CNAME records via MS SQL Server Plus Plugin
Problem reported by cpdev - March 28, 2014 at 1:53 PM
Not A Problem
When using the MS SQL Server Plus Plugin, when performing a nslookup for a record that exists as a CNAME record, the resulting IP addresses come back as a duplicate. I think this is a bug. Not using the SQL plugin produces different results.

To verify, I hard-coded the following SQL Statement for the SQL Plus plugin:
SELECT 'www.ryan.com' as RecData, 'testing.ryan.com' as RecName, 'CNAME' as RecType
UNION ALL
SELECT '1.1.1.1' as RecData, 'www.ryan.com' as RecName, 'A' as RecType
 
which produces the following SQL results:

RecData | RecName | RecType
www.ryan.com | testing.ryan.com | CNAME
1.1.1.1 | www.ryan.com | A
 
However, I get this when using nslookup when the SQL Plugin is configured with the above SQL Statement. (nslookup has set type=A, attempting to resolve 'testing.ryan.com'):

> testing.ryan.com
Server: [2.2.2.2]
Address: 2.2.2.2
Name: www.ryan.com
Addresses: 1.1.1.1
1.1.1.1
Aliases: testing.ryan.com
 
The bug is that the IP address is listed twice, and it should only be listed once.
 
When configuring the exact same CNAME record ('testing.ryan.com') and the exact same corresponding A record ('www.ryan.com') directly within a SimpleDNS zone (that is, a local zone not using SQL plugin), I get this:
 
> testing.ryan.com
Server: [2.2.2.2]
Address: 2.2.2.2
Name: www.ryan.com
Addresses: 1.1.1.1
Aliases: testing.ryan.com
 
Note that the IP address here is correctly listed only once, as there is only one A record for 'www'.
 
Can you please confirm if this is a bug?
== ALSO ==
For matching CNAMEs discovered to exist when a DNS query is performed for an A record, does the SQL Statement for the plugin need to return data in different format than what is shown by the SQL Statement above? If so, what is SimpleDNS expecting in the SQL results for A record queries with CNAMEs?

2 Replies

Reply to Thread
0
JH Software Replied
April 3, 2014 at 1:41 AM
Employee Post
This is not a bug.
The reason for the double IP address is that "nslookup" actually sends two DNS requests - one or A-records and one for AAAA-records (IPv6). Your sample SQL code does not examine the request type (the optional @QTYPE parameter), and therefore returns the same A-record in response to both queries.
You can get a better idea of how this happens by typing "set debug" (and return) in nslookup before the host name - then nslookup will output full details.
 
The CNAME format that your SQL statement returns is fine.
 
 
0
cpdev Replied
April 4, 2014 at 1:22 AM
Thanks for the 'set debug' tip. It turns out that the problem was indeed that my query was returning both the A record and the AAAA record. FYI: So as not to mislead people, I changed the title of this post to better reflect that this is not a bug. 
 
Thanks again! 

Reply to Thread