Refactor get of hostname

Add DomainNameSystem class to be used to reverse ip address to DNS. Use it instead of os.hostname() as this method was not returning correct results on mac machine.