1

I am trying to connect to a site with curl but it returns error 503.

I thought maybe the site blocked my IP. I bought another IP for my VPS and connected with this IP to that site but still I can not connect and have the same error.

I view the cURL output and see two my requests have the same primary IP but different local IP.

The primary IP is not in my purchased IP list. What does primary IP represent in the cURL output?

Array ( 
  [url] => http://adsl.tci.ir/ 
  [content_type] => text/html; charset=UTF-8 
  [http_code] => 302 
  [header_size] => 366 
  [request_size] => 50 
  [filetime] => -1 
  [ssl_verify_result] => 0 
  [redirect_count] => 0 
  [total_time] => 0.01543 
  [namelookup_time] => 0.004182 
  [connect_time] => 0.0057 
  [pretransfer_time] => 0.005737 
  [size_upload] => 0 
  [size_download] => 13458 
  [speed_download] => 872197 
  [speed_upload] => 0 
  [download_content_length] => -1 
  [upload_content_length] => 0 
  [starttransfer_time] => 0.015135 
  [redirect_time] => 0 
  [redirect_url] => http://adsl.tci.ir/panel 
  [primary_ip] => 217.218.86.7 
  [certinfo] => Array ( ) 
  [primary_port] => 80 
  [local_ip] => 185.208.174.63 
  [local_port] => 57646 
)
ADyson
  • 57,178
  • 14
  • 51
  • 63
  • Running `ping adsl.tci.ir` from a command prompt resolves to `217.218.86.7` as the target IP address. So `primary IP` is the address that you are sending the request to. It's the IP address which is mapped to `adsl.tci.ir` in DNS. Therefore it's not surprising that it is not in your list of purchased IP addresses. – ADyson Mar 08 '19 at 10:47
  • P.S. I tried to visit `http://adsl.tci.ir/panel` in my browser and received `504 Gateway timeout` error - similar to your 503 error really. And the `ping` request I sent also timed out without getting a response. So I suspect this site is simply offline. Did you try to test it from another place (e.g. just your local machine) before spending money on a second IP address?? What led you to the conclusion you had been blocked? – ADyson Mar 08 '19 at 10:50

1 Answers1

2

The local IP is the IP local to you. i.e. it is your IP address.

The primary IP is the IP you are making the request to. i.e. it is the IP that adsl.tci.ir resolves to.

[ ~ ] ➜  host adsl.tci.ir
adsl.tci.ir has address 217.218.86.7
Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335