Why did I get result code -2?

PayPal presented result code -2 - Failed to resolve hostname.

There are three reasons why you may receive result code -2:

  • DNS (Domain Name Service) isn't set up correctly.
  • HOSTADDRESS values are incorrect.
  • "Null" is being passed within the proxy parameters.

Solutions DNS not set up correctly
To determine if DNS setup caused the error, open a command prompt and type nslookup pilot-payflowpro.paypal.com. (nslookup is a Windows program. If you're running another OS, use a function that provides similar results.) The results displayed should look like this:

Server: <your local domain>
Address: <your local IP address>

Name: pilot-payflowpro.paypal.com

If the IP address returned isn't what is listed above or within the same range (see What are the IP addresses for Payflow servers), clear your DNS cache. If the nslookup command produces a timeout response or causes any other error to be displayed, your DNS server isn't set up or configured correctly. Contact your IT department or ISP.  
Host address incorrect
Verify that the HOSTADDRESS values are correct. These should be:
  • Live server: payflowpro.paypal.com
  • Test server: pilot-payflowpro.paypal.com

Update your HOSTADDRESS values if necessary.  
"NULL" being passed within the proxy parameters
If you're not using a proxy server, leave the information blank by entering two double quotes, as shown in the following example.

Correct: ProxyAddress = "
Incorrect: ProxyAddress = "Null"

Note: If you use an IP address instead of a domain name, any changes made to PayPal's DNS will cause your transactions to fail. As a result, you'll have to update your application, website, and so on, with the new IP address each time DNS changes.