Cleanup whitespace.
Cleaned up conditional blocks.
Added conditional block to handle null return from dns request.