add exception to dns resolving: if resolving fails set status to false

When dns resolving don't work for any reason, this construction:
site_ip = socket.gethostbyname(site) 
Causes error and execution stop, it leads to failures because in this case gateway will not be switched - execution will stop earlier.