Does the cURL request in php resolve a subdomain locally?

0

I have a Ubuntu 14.04 Trusty VPS server and I wonder if using the cURL library resolves DNS locally to a subdomain.

I have 2 domains on the same server and 1 is a subdomain (Webservice).

Making a call from cURL to the webservice will the same be resolved local or will it go through the internet?

If I go through the internet how do I resolve it locally?

(I'm evaluating this because I believe that resolving locally will shorten the request time)

    
asked by anonymous 03.06.2015 / 23:32

1 answer

2

If you have root permissions, you can log in via SSH and do something like

# echo '0.0.0.0 example.net' >> /etc/hosts

(of course, changing IP and domain to appropriate values)

Unless cURL does something very creative with DNS resolution, this should make cURL (and all applications on your server) resolve the IP pro domain you specify.

    
03.06.2015 / 23:45