1

For whatever reason, my computer (Mac OS X 10.11.1) cannot fetch a webpage from a website using curl when it works fine on other computers. Also ping works but curl doesn't:

$ ping www.latex-tutorial.com
PING latex-tutorial.com (162.252.172.25): 56 data bytes
64 bytes from 162.252.172.25: icmp_seq=0 ttl=54 time=76.116 ms
64 bytes from 162.252.172.25: icmp_seq=1 ttl=54 time=74.538 ms
64 bytes from 162.252.172.25: icmp_seq=2 ttl=54 time=90.379 ms
^C
--- latex-tutorial.com ping statistics ---
3 packets transmitted, 3 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 74.538/80.344/90.379/7.125 ms

Now when curl was executed on the problematic machine several times:

$ curl http://www.latex-tutorial.com
curl: (52) Empty reply from server
$ curl -Lv http://www.latex-tutorial.com
* Rebuilt URL to: http://www.latex-tutorial.com/
*   Trying 2a02:748:a800:162:252:172:25::...
* Connected to www.latex-tutorial.com (::1) port 80 (#0)
> GET / HTTP/1.1
> Host: www.latex-tutorial.com
> User-Agent: curl/7.43.0
> Accept: */*
>
* Empty reply from server
* Connection #0 to host www.latex-tutorial.com left intact
curl: (52) Empty reply from server

When I execute the same command on a different Mac laptop (same version) in the same network, I do get a correct html web page every time. What could possibly be wrong with my machine? I did download a few things off the internet where my machine could have potentially contracted a virus/malware, but my antivirus program wasn't able to detect anything.

Can anyone point me to where I should start looking for errors?

1 Answer 1

1

Try adding the -4 option to your curl command line. Alternatively, try http://162.252.172.25 and see what you get. The ping is using that address, which is an IPv4 address. The curl is using IPv6, with an address starting with 2a02. Not all IPv6 stacks are equally robust - perhaps yours has connection issues.

2
  • Thanks! -4 option makes this work, but when I try with '162.252.172.25' I get "HTTP/1.1 301 Moved Permanently" and the resulting redirection still leaves me with "Empty reply from server". I'm a bit unsure why this is happening.
    – sia831
    Nov 14, 2015 at 5:58
  • After seeing some strange logs in my system log about Avast screwing up with my network, I uninstalled it and now the network is running fine. Not installing an antivirus program from now on... Anyways thanks for your help! :)
    – sia831
    Nov 14, 2015 at 6:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .