Pollution in archives due to search domains in resolv.conf
@hook54321a brought up on IRC that a pipeline retrieved http://www/ successfully ([Wayback Machine](https://web.archive.org/web/20180511142946/http://www/)). The reason for this is that there's a `search ovh.net` line on the pipeline's `resolv.conf`, meaning that `www` resolves to `www.ovh.net`. It appears that this is not a new issue; [here](https://web.archive.org/web/20160514054923/http://www/)'s an example snapshot of Online.net's website from two years ago, captured through the same URL by an ArchiveBot pipeline.

We are not alone with this problem: there are various other snapshots showing all kinds of responses (e.g. [one](https://web.archive.org/web/20151213003158/http://www/), [two](https://web.archive.org/web/20150201002312/http://www/)), and IA even captured *itself* under that URL at least once [back in 2005](https://web.archive.org/web/20050331120708/http://www/).

Still, we need to find a way to prevent this from happening to avoid pollution in the archives. @ivan suggested testing whether `www` resolves in the preflight check, but this might not always be reliable because `www` might not resolve on the search domain while other (sub)domains work fine. Another option might be explicitly testing whether `/etc/resolv.conf` contains a `search` line, though that would obviously not work on all OS. Yet another option would be implementing a custom DNS resolving stack which completely ignores the DNS configuration in `resolv.conf` (i.e. communicates with specific DNS servers directly), but that's probably not a good idea.

In any case, the current pipelines also need to be fixed of course. Ping to the current pipeline operators: @Asparagirl, @chronomex, @falconkirtaran, @HarryC145, @MattIggo. My pipelines are not affected.
diff --git a/pipeline/archivebot/seesaw/tasks.py b/pipeline/archivebot/seesaw/tasks.py
index b511c9c..f11cca8 100644
--- a/pipeline/archivebot/seesaw/tasks.py
+++ b/pipeline/archivebot/seesaw/tasks.py
@@ -37,6 +37,18 @@ class CheckIP(SimpleTask):
             raise Exception(
                 'Are you behind a firewall/proxy? That is a big no-no!')
 
+        # Domains that are not supposed to resolve
+        for domain in ('domain.invalid', 'nxdomain.archiveteam.org', 'www'):
+            try:
+                ip = socket.gethostbyname(domain)
+            except socket.gaierror as e:
+                if e.errno != socket.EAI_NONAME:
+                    raise
+            else:
+                item.log_output('Got an IP address ({}) for {} instead of NXDOMAIN'.format(ip, domain))
+                item.log_output('Are you behind a firewall/proxy or have a misconfigured resolv.conf? That is a big no-no!')
+                raise Exception('Are you behind a firewall/proxy or have a misconfigured resolv.conf? That is a big no-no!')
+
 
 class RetryableTask(Task):
     retry_delay = 5
['pipeline/archivebot/seesaw/tasks.py']