Improved port specification. Removed duplicated dns resolver