0

I am connecting to a VPN server with piehole adblocker using a Ubuntu machine and on Vpn Server, I have blocked some particular sites. When I try to access it with a browser, I am unable to open those sites. But when I hit with curl request or ping that site in the terminal, I am able to get success response.

Is there a way to know from the terminal if a site is blocked or not. And how to get its status code.

0

Yep ! nslookup websitename

denis:~ $ nslookup google.com
Server:     127.0.1.1
Address:    127.0.1.1#53

Non-authoritative answer:
Name:   google.com
Address: 216.58.204.142

denis:~ $ nslookup googleadservices.com
Server:     127.0.1.1
Address:    127.0.1.1#53

Name:   googleadservices.com
Address: 0.0.0.0
  • thanks, your answer also worked. I used curl -sL $url -w "%{url_effective}, %{http_code}" -o /dev/null to get the required response code – Anshul Arora Apr 4 at 8:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.