Added logging
added DNS resolution