title: DNS Resolver does not contain answer
body: <p>I'm trying to automate some of the tasks with python. I have to chcek if some domains are still in ours DNS servers. So searching through stack i found script with dns.resolver and tryied to suit it to my needs. 
  So, the script looks like this:</p>
  
  <pre><code>import socket
  import dns.resolver
  
  
  mylist=[]
  with open('domainfile.txt') as file:
      for line in file:
          mylist.append(line)
  length = len(mylist)
  
  
  resolver = dns.resolver.Resolver()
  resolver.nameservers=[socket.gethostbyname('dns.example.com')]
  
  for i in range(length):
      for rdata in resolver.query(mylist[i], 'CNAME') :
          print(rdata.target)
  </code></pre>
  
  <p>My <code>domainfile.txt</code> looks like this:</p>
  
  <pre><code>domain1
  domain2
  domain3
  [...]
  </code></pre>
  
  <p>And error message i recived is:</p>
  
  <blockquote>
    <p>Traceback (most recent call last):
      File "dnspython.py", line 20, in 
        for rdata in resolver.query(lista[i], 'CNAME') :
      File "/usr/local/lib/python3.7/dist-packages/dns/resolver.py", line 1053, in query
        raise_on_no_answer)
      File "/usr/local/lib/python3.7/dist-packages/dns/resolver.py", line 236, in <strong>init</strong>
        raise NoAnswer(response=response)
    dns.resolver.NoAnswer: The DNS response does not contain an answer to the question: domain1\010.example.com. IN CNAME</p>
  </blockquote>
  
  <p>If I just insert my domain inside <strong>if statement</strong> instead of iterate through the <strong>mylist</strong> I get what I need. But when I try to do it through the list it adds to my domain <strong>\010</strong> and then nothing happens. 
  Can you help me with this? 
  Thanks!</p>