fix DNS resolution problem

This one at the moment intends to fix point 3 from #588 
now working on point 1 and  2