General advice about this kind of algorithm:

Generally you'll find the data is nearly infinitely cacheable.  The data changes so rarely that you might as well do it in batch and save the data to a on-disk cache that all your code uses.  The TTL on the data might be 1 hour, but when I was on the internet mapping project we found that as far as domains changing, the data was stable for more than a year.

If you are doing a lot of DNS queries, rate-limit how many you send to any particular DNS server.  Otherwise it is rude at best, and a DoS attack at worst.


If you can generate all the DNS queries you plan on doing ahead of time, and they'll fit in RAM or on disk, generate the list, randomize it, then do the lookups in random order.
A lazy way to do it, that doesn't require enumerating every query in advance, is to spread out the queries among all the CIDR blocks.  That is, if you are doing 500 CIDR blocks, do the .1 address in all of them, then the .2 address in all of them, then the .3 address, etc.  The result is that you put less stress on the individual DNS servers.  (this works particularly well if you are doing thousands of lookups on millions of CIDR blocks)


If you are doing the lookups "on demand", just use some kind of write-through cache and you should be fine.

Get IP network range after reverse DNS?
I have index.tex that I made a copy of it. renamed the copy to index_bad.tex, and added the line

\usepackage[pdfpagelabels]{hyperref}


to its preamble. So the 2 files are identical other than this one change.

Then compiled index.tex with pdflatex 3 time and looked at the index.pdf, and it is ok. (i.e. no blank page).

Compiled index_bad.tex with pdflatex 3 times. Now index_bad.pdf has an extra blank page inserted between first section and the second section.

This is the general layout of the document:

\documentclass[12pt]{article}
\usepackage{tikz}
\usepackage{fancyvrb}
\usepackage{graphicx}
\usepackage[left=.7in,right=.5in,top=.7in,bottom=.9in]{geometry}
\usepackage[pdfpagelabels]{hyperref}
\begin{document}
....
\section{....}
\subsection{...}
\begin{Verbatim}[frame=single,framesep=1mm,samepage=true,fontsize=\footnotesize]
.....
\begin{Verbatim}[frame=single,framesep=1mm,samepage=true,fontsize=\footnotesize]
....
\end{document}


When including hyperref a blank page shows up between first section, and the second section.  No blank page shows up when this package is not included.

question is why does this happen? and how to fix it?

Since this document includes 2 images and large verbatim, I've zipped the whole folder so it is all self contained. 

Unziping the zip file will create a folder. Inside the folder there is index.tex and index_bad.tex and the 2 images used. Running pdflatex on the files will show the problem above.

The zip file is http://12000.org/tmp/072113/latex_problem.zip

Using TL 2013 on Linux mint virtual machine hosted on windows.


