Celeb Glow
news | March 16, 2026

How to solve Fastly error: unknown domain

I'm trying to accomplish this task, I have an IP and with the IP I want to make an HTTP request.

Let's say that I have the stackoverflow.com IP (151.101.193.69) and I want to make an HTTP request at the website with python using the requests module. I wrtie this code

import requests
response = requests.get("")
response.text

that returns the html code of the page. Doing so I get a page that says

Fastly error: unknown domain: 151.101.193.69. Please check that this domain has been added to a service.
Details: cache-mxp19846-MXP

But if I do this with the Google IP it works and the request returns the Google home page

import requests
response = requests.get("")
response.text
2

1 Answer

Yes, that's normal.

HTTP requests always include a "Host:" header indicating what name was actually used in the URL. For example, accessing will send a header Host: superuser.com; and if you're using , the header will of course show Host: 151.101.193.69 (or even be completely absent).

The important bit is that many HTTP servers share the same IP address for many different domains (aka virtual hosting), and they rely on this header to know which domain you're trying to access.

For example, all Stack Exchange domains – superuser.com, stackoverflow.com, serverfault.com, diy.stackexchange.com, … – share the exact same set of IP addresses. The only way for the webserver to distinguish between all these websites is by looking at the "Host" HTTP header.

(Additionally, these addresses actually belong to Fastly CDN, not to the real webservers. Large CDNs such as Fastly or CloudFlare might use the same IP address for hundreds of domains from various different customers.)

Finally, it is up to the server to decide what it'll do with "Host" headers that it doesn't recognize. Some servers return an error page stating so, other servers return the "first" domain that they have.


So in order to make a successful request, you'd need to do this:

requests.get("", headers={"Host": "stackoverflow.com"})

But that's a silly way of saying requests.get(""). The only time you might need this method is when you have an IP address that doesn't match the DNS information (e.g. if you're trying to bypass DNS).

(And it will cause you more problems as soon as you try to access a HTTPS website, because the domain from the URL is used for checking TLS certificates, too.)

2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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