Make DNS test standalone.

nit:
with open(name, "w") as f:
  f.write(content)