diff options
Diffstat (limited to 'src')
-rwxr-xr-x | src/perform_queries.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/perform_queries.py b/src/perform_queries.py index fef1300..c568bf6 100755 --- a/src/perform_queries.py +++ b/src/perform_queries.py @@ -61,11 +61,18 @@ def resolve_call_back(mydata, status, result): query = mydata # debugging print("callback called for {}".format(result.qname)) - if status==0 and result.havedata: + if status != 0: + result_info = 'internal failure: out of memory' + elif result.rcode == 0: result_info = 'successful' print("Result:",result.data.address_list) + elif result.rcode == 2: + result_info = 'no response' + elif result.rcode == 3: + result_info = 'not exists' else: - result_info = 'not found' + result_info = 'DNS error: {}'.format(result.rcode_str) + # write to database try: query.cursor.execute(''' |