Bash - get page source with cURL connection by IP address when we know domain name

9 points
Created by:

In this short article, we would like to show how to get page source using cURL connection by IP address when we know the domain name under Bash.

Run the following command in the command line:

curl -k -H "Host:"


curl -H "Host:"


  • -k lets to get a connection accepting untrusted or self-signed certificates,
  • should be set according to the assigned domain on the run server,
  • should be changed to IP address that lets to access the server.

Example output:

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0

<!DOCTYPE html>
<html lang="en">
  <title>Site title here ...</title>
  <meta name="keywords" content="keyword-1, keyword-2, keyword-3">
  <meta name="description" content="Some description here ...">
  <!-- ... -->
  <!-- ... -->


The above command should get the same effect like:

curl -k



Alternative titles

  1. Bash - get page source with cURL accepting untrusted certificate
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

â€ïžđŸ’» 🙂