Strange CNAME issues

71 views
Skip to first unread message

Andrei Romila

unread,
Aug 20, 2015, 11:03:09 AM8/20/15
to dnspython-bugs
Hello,

I am having some strange issues with dnspython and CNAME record fetching
exampled below:

===
>>> for i in dns.resolver.query('1.smtp.antispamcloud.com',
'cname'):

...  i.exchange
...
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/site-packages/dns/resolver.py", line 981,
in query
    raise_on_no_answer, source_port)
  File "/usr/local/lib/python2.7/site-packages/dns/resolver.py", line 912,
in query
    raise_on_no_answer)
  File "/usr/local/lib/python2.7/site-packages/dns/resolver.py", line 145,
in __init__
    raise NoAnswer
dns.resolver.NoAnswer
===

However there should definitely be an answer there. Since I was
experiencing problems I made my own CNAME to test this out and the result
is different but not better.

===
>>> dns.resolver.query('www.mail.zigurat.fr', 'CNAME')
<dns.resolver.Answer object at 0x7fd00ef44750>
>>> dns.resolver.query('www.mail.zigurat.fr', 'CNAME')
<dns.resolver.Answer object at 0x7fd00ea55a90>
>>> dns.resolver.query('www.mail.zigurat.fr', 'CNAME')
<dns.resolver.Answer object at 0x7fd00ef44750>
>>> dns.resolver.query('www.mail.zigurat.fr', 'CNAME')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/site-packages/dns/resolver.py", line 981,
in query
    raise_on_no_answer, source_port)
  File "/usr/local/lib/python2.7/site-packages/dns/resolver.py", line 910,
in query
    raise NXDOMAIN
dns.resolver.NXDOMAIN
>>> dns.resolver.query('www.mail.zigurat.fr', 'CNAME')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/site-packages/dns/resolver.py", line 981,
in query
    raise_on_no_answer, source_port)
  File "/usr/local/lib/python2.7/site-packages/dns/resolver.py", line 910,
in query
    raise NXDOMAIN
dns.resolver.NXDOMAIN
===

These problems do now show up using dig (+/- trace).

Could you please have a look and shed some light?

Thanks alot!

Kind regards,
Andrei

James Raftery

unread,
Aug 20, 2015, 2:27:29 PM8/20/15
to Andrei Romila, dnspython-bugs
Hi,

I can't replicate your first problem. Can you try with

 dns.resolver.query('1.smtp.antispamcloud.com', 'CNAME', raise_on_no_answer=False)

and examine the response data to see what's actually arriving?


This is why you're seeing problems with the second test:

[ec2-user@ip-172-30-0-24 ~]$ dig @ns2.zigurat.fr. www.mail.zigurat.fr

; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.30.rc1.38.amzn1 <<>> @ns2.zigurat.fr. www.mail.zigurat.fr
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 12442
;; flags: qr aa rd; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0
;; WARNING: recursion requested but not available

;; QUESTION SECTION:
;www.mail.zigurat.fr.           IN      A

;; AUTHORITY SECTION:
zigurat.fr.             3600    IN      SOA     ns1.zigurat.fr. andrei.zigurat.fr. 2930319368 3600 600 86400 86400

;; Query time: 144 msec
;; SERVER: 107.181.153.36#53(107.181.153.36)
;; WHEN: Thu Aug 20 18:21:36 2015
;; MSG SIZE  rcvd: 84

[ec2-user@ip-172-30-0-24 ~]$ 




james


--
You received this message because you are subscribed to the Google Groups "dnspython-bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dnspython-bug...@googlegroups.com.
Visit this group at http://groups.google.com/group/dnspython-bugs.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages