Does the Curl request in php resolve a subdomain locally?

Asked

Viewed 137 times

0

I have a server with Ubuntu 14.04 Trusty VPS and would like to know if using the Curl library solves DNS locally for a subdomain.

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

Making a call from Curl to the webservice the same will be solved local or it will go over the internet?

If you go over the Internet like I do to solve it locally?

(I am evaluating this because I believe that resolving it locally will decrease the time of the request)

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 the IP and the domain to the appropriate values)

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

  • How do I put this: $Curl = curl_init("http://mydomain.com/service-test/get_client");

  • This is my question.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.