I have recently setup a personal website using github pages for hosting and DNS with freenom.

When I make a request using curl:

curl --header "Host: example.com"

I get the expected response, the HTML from my site, however, when I try to access the page through a web browser I get a generic

example.com’s server DNS address could not be found.

Is/are there a reason(s) why I am getting what appears to be mixed results?

Note: I followed the instructions I found on stackoverflow about how to set this up.

  • Write in your browser directly Your DNS is not able to resolve the address in IP. When you incur in problem like that simplify your command line from all the not needed parts, and for your command becomes curl where it is evident that you are not asking to reach example.com but that IP. :-) – Hastur Mar 15 '16 at 6:33

With the Curl call you are not using DNS, you are asking curl to go direct to the destination IP, but to tell the server which site you are after by sending a host: header.

With your browser, you are just putting the URL straight into the address bar, and so your DNS server must resolve example.com. It is unable to and so produces an error.

So the conclusion is that the DNS is not set up correctly.

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.