Add ffi for resolving domain name and create socket connection