Thanks for the input and sorry for posting here

But my problem is not yet solved

The domain which I am querying has no other records, on records are the NS 
records and that were in authority section
So it6 is giving error of no answer present when 
dns.resolver.query(domain,'NS')    performed


Through dig command I am able to get the output
Eg .
; <<>> DiG 9.7.3-P1-RedHat-9.7.3-2.el6_1.P1.1 <<>> Domain   . -t NS
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 58635
;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 2, ADDITIONAL: 0
;; WARNING: recursion requested but not available

;; QUESTION SECTION:
;Domain   IN      NS

;; AUTHORITY SECTION:
Domain   86400 IN   NS      nameserver1
Domain   86400 IN   NS      nameserver2

;; Query time: 1 msec
;; SERVER: servername
;; WHEN: Thu Aug  9 14:23:46 2012
;; MSG SIZE  rcvd: 114

Can you tell me how can I resolv this error
As you can see it has no answer section , only authority section is present.

Regards
Pankaj Rawat

From: Bob Halley [mailto:[email protected]]
Sent: Wednesday, August 08, 2012 5:57 PM
To: Pankaj Rawat
Cc: [email protected]
Subject: Re: [dnspython-dev] How to query authority section


On 7 Aug 2012, at 11:50, Pankaj Rawat 
<[email protected]<mailto:[email protected]>> wrote:


Hi All,

Actually I am not able to findout how to query Authority section using DNS 
python.
Can anyone tell me how to do it?

This kind of question is better asked on dnspython-users.  The answer is to use 
the "authority" field of the message object, e.g.

#!/usr/bin/env python

import dns.resolver

answers = dns.resolver.query('dnspython.org<http://dnspython.org>', 'MX')
for rdata in answers:
    print 'Host', rdata.exchange, 'has preference', rdata.preference
print '; AUTHORITY'
for rrset in answers.response.authority:
    print rrset

/Bob




DISCLAIMER:

-----------------------------------------------------------------------------------------------------------------------

The contents of this e-mail and any attachment(s) are confidential and
intended

for the named recipient(s) only. 

It shall not attach any liability on the originator or NECHCL or its

affiliates. Any views or opinions presented in 

this email are solely those of the author and may not necessarily reflect the

opinions of NECHCL or its affiliates. 

Any form of reproduction, dissemination, copying, disclosure, modification,

distribution and / or publication of 

this message without the prior written consent of the author of this e-mail is

strictly prohibited. If you have 

received this email in error please delete it and notify the sender

immediately. .

-----------------------------------------------------------------------------------------------------------------------
_______________________________________________
dnspython-dev mailing list
[email protected]
http://howl.play-bow.org/mailman/listinfo/dnspython-dev

Reply via email to