"Error 1003: Direct IP access not allowed" means a request reached Cloudflare using a raw IP address instead of a domain name. The Cloudflare Error 1003 fix is almost always a small change on the client side, because the block comes from Cloudflare's edge network, not the website's own server.
Cloudflare's edge is shared infrastructure. One IP address can sit in front of many different sites, and the only way the network knows which site you want is the Host header your client sends. Type a bare IP into a browser, or hardcode one into a script, and there is no hostname to match to a zone, so Cloudflare refuses the request and serves the 1003 page. The 1003 code appears in the HTML body of the response, which is how all of Cloudflare's 1xxx errors are delivered.
Two symptoms confirm you are looking at this error and not something else. First, the same site loads normally through its domain name, and only the IP-addressed request fails. Second, changing your network, VPN, or IP address makes no difference, because the error has nothing to do with your address's reputation. It surfaces most often in uptime monitors, cron jobs, webhooks, CI steps, and API clients that were pointed at a numeric address: sometimes a stale origin IP that now resolves to Cloudflare, sometimes an edge IP copied out of a DNS lookup.
Site owners who spot Error 1003 in their logs usually have nothing to repair: automated scanners probe IP ranges directly, and Cloudflare turning them away is the system working as intended. The fix matters when the request came from something of yours, or from a visitor who reached the IP by accident.
Quick recommendation. If you hit this in a browser, jump to the domain-name fix. If it comes from a script or monitor, the Host header and configuration fix is the one you need.
What Is Cloudflare Error 1003?
Cloudflare Error 1003 occurs when someone attempts to access a website by typing the server's IP address directly into their browser instead of using the domain name. Cloudflare acts as a protective proxy between visitors and web servers, and it blocks direct IP requests to maintain security. This ensures all traffic passes through Cloudflare's CDN and security filters.
Because many sites share one IP, Cloudflare needs the domain name to route the request. Without it, the edge has no zone to match, so it returns Error 1003.
This error is part of Cloudflare's 1xxx error series, which includes other common blocks like Error 1015 (rate limiting) and Error 1020 (firewall blocks).
Why Does Cloudflare Error 1003 Happen?
Both website visitors and administrators can trigger this error.
Misconfigured DNS Records
Website owners configure DNS records within Cloudflare's dashboard. Records can be set to "Proxied" (orange cloud icon) or "DNS Only" (grey cloud icon).
When critical records are set to DNS Only, the server's IP address becomes visible. Users might then access the site directly via IP, triggering the error because the request bypasses Cloudflare's proxy.
Users Typing IP Addresses Directly
Sometimes visitors accidentally type an IP address into their browser's address bar. This happens when users copy-paste server information or click old bookmarks that contain raw IPs.
Cloudflare immediately blocks these requests since they don't pass through the proper routing channels.
Automated Scripts and Bots Using IPs
Web scrapers, API clients, and automated tools sometimes hardcode IP addresses instead of domain names. When these tools target the origin server directly, Cloudflare intercepts and blocks the request with Error 1003.
This is common with older scripts that were written before the website migrated to Cloudflare.
Misconfigured Plugins or Applications
Third-party plugins, CDN integrations, or server-side applications might communicate using the origin IP rather than the domain. This misconfiguration causes internal requests to fail with the same error.
How to identify Cloudflare error code 1003
Error code 1003 means Cloudflare refused the request because it was addressed to a Cloudflare IP address instead of the website's domain name. Cloudflare sits between visitors and the origin server, and its edge routes traffic by hostname. A request sent straight to one of its IPs gives the edge no way to tell which site you want, so it blocks the request and shows the 1003 page. Confirm that this is the error you're getting before you change any settings, because a few other errors look similar at first glance.
What the 1003 error code page looks like in a browser
In a browser, Cloudflare shows a branded error page with these elements:
- Error message: "Direct IP access not allowed", usually shown as "Access denied" in the page title
- Error code: 1003, displayed prominently near the top
- Cloudflare branding: the logo and page styling come from Cloudflare's network. The site you were trying to reach did not build this page.
- Ray ID: a unique identifier for the blocked request. Copy it if you contact the site owner, because it lets them find that exact request in their Cloudflare logs.
What "error code: 1003" looks like in scripts and API calls
HTTP clients, scrapers, and command-line tools often get no styled page. The response body can be a single line of plain text reading error code: 1003. If your scraper logs show this string, the cause is the same as in the browser: the request went to an IP address, not to the domain. Check the URL your code builds, any hardcoded IPs in config files, and any hosts-file or DNS overrides on the machine running the script.
Quick checks to confirm it's error code 1003
- Look at the address bar or the request URL. If it starts with a bare IP address instead of a domain name, that matches the 1003 cause.
- Open the same page using the site's normal domain. If it loads, direct IP access is the problem.
- Check that the page names Cloudflare and includes a Ray ID. Without either, the block may come from a different firewall or CDN.
Other errors that use the code 1003
Some unrelated software uses the same number. A password manager, for example, reports "error code 1003" when the local date, time, or time zone on a Windows computer is set incorrectly, and the fix is to correct the clock. If your 1003 message comes from a desktop app and not from a web page or HTTP response, it is not the Cloudflare error and the fixes in this guide won't apply.
If you see the Cloudflare version, the request was blocked for connecting by IP address and not through the domain. Either fix below routes it through the domain.
Error code 1003: which fix do you need?
Error code 1003 always has the same cause, but where you see it decides the fix. Match your situation to one of these cases before you change any settings.
- You typed or clicked a URL that starts with numbers in a browser: replace the IP with the site's domain name, then update the bookmark or link that sent you there.
- A script, scraper, or API client logs error code 1003: find where the code builds its URL and swap any hardcoded IP for the domain. Check config files, environment variables, and hosts-file entries on the machine running it.
- You own the site and see 1003 in your logs: check whether the requests came from your own tools. If they came from scanners probing IP ranges, Cloudflare is already blocking them correctly and nothing needs fixing.
- One of your own services calls the origin through an IP that now belongs to Cloudflare: point it at the domain, or at a separate DNS Only hostname if it has to reach the origin directly.
The error clears as soon as the request carries the domain name. Switching your IP address, VPN, or browser won't change the result, because the block depends only on how the request was addressed.
How to Fix Cloudflare Error 1003 (For Website Administrators)
If you manage a website showing this error to visitors, check these settings.
Step 1: Verify DNS Records Are Proxied
Log into your Cloudflare dashboard and navigate to DNS settings. Check that your A, AAAA, and CNAME records pointing to your web server show an orange cloud (Proxied) status.
Grey cloud icons mean traffic goes directly to your server without Cloudflare protection. Switch these to Proxied for proper routing.
Step 2: Review Firewall and Security Rules
Navigate to Security > WAF in your Cloudflare dashboard. Check for any rules that might inadvertently affect legitimate traffic patterns.
While firewall rules rarely cause this error directly, misconfigured rules can create confusing access issues.
Step 3: Block Direct IP Access at the Server Level
To restrict origin access, configure your origin server to only accept connections from Cloudflare's IP ranges. This prevents anyone from bypassing Cloudflare entirely.
Nginx Configuration:
Add this to your server block:
# Allow Cloudflare IPs only
set_real_ip_from 103.21.244.0/22;
set_real_ip_from 103.22.200.0/22;
set_real_ip_from 103.31.4.0/22;
set_real_ip_from 104.16.0.0/13;
set_real_ip_from 104.24.0.0/14;
set_real_ip_from 108.162.192.0/18;
set_real_ip_from 131.0.72.0/22;
set_real_ip_from 141.101.64.0/18;
set_real_ip_from 162.158.0.0/15;
set_real_ip_from 172.64.0.0/13;
set_real_ip_from 173.245.48.0/20;
set_real_ip_from 188.114.96.0/20;
set_real_ip_from 190.93.240.0/20;
set_real_ip_from 197.234.240.0/22;
set_real_ip_from 198.41.128.0/17;
real_ip_header CF-Connecting-IP;
This configuration tells Nginx to trust only Cloudflare's IP ranges and extract the real visitor IP from the CF-Connecting-IP header.
Apache Configuration:
Add this to your VirtualHost or .htaccess:
<IfModule mod_remoteip.c>
RemoteIPHeader CF-Connecting-IP
RemoteIPTrustedProxy 103.21.244.0/22
RemoteIPTrustedProxy 103.22.200.0/22
RemoteIPTrustedProxy 103.31.4.0/22
RemoteIPTrustedProxy 104.16.0.0/13
RemoteIPTrustedProxy 104.24.0.0/14
RemoteIPTrustedProxy 108.162.192.0/18
</IfModule>
Check Cloudflare's official IP ranges documentation for the complete current list, as these may change over time.
Step 4: Use Cloudflare Authenticated Origin Pulls
For an additional layer, enable Authenticated Origin Pulls in Cloudflare. This feature requires a valid Cloudflare certificate for any connection to your origin server.
Go to SSL/TLS > Origin Server in your dashboard and enable Authenticated Origin Pulls. Then configure your web server to require the Cloudflare client certificate.
How to Fix Cloudflare Error 1003 (For Website Visitors)
If you're encountering this error as a regular user, try these solutions.
Check Your Browser's Address Bar
Make sure you're using the actual domain name (example.com) rather than an IP address. If the URL starts with numbers like 104.24.x.x, that's the problem.
Type the correct domain name and the error should resolve immediately.
Clear Browser Cache and DNS Cache
Old cached DNS records might point to outdated IP addresses. Clear your browser cache and flush your local DNS cache.
On Windows, open Command Prompt and run:
ipconfig /flushdns
On macOS, open Terminal and run:
sudo dscacheutil -flushcache
sudo killall -HUP mDNSResponder
Update Bookmarks and Saved Links
If you clicked an old bookmark containing an IP address, update it with the proper domain. Right-click the bookmark and edit the URL.
How to Handle Cloudflare Error 1003 for Web Scraping
Developers building web scrapers frequently encounter this error when their code targets IP addresses instead of domains.
Always Use Domain Names in Requests
Update your scraper code to request the domain rather than the IP:
import requests
# Wrong - triggers Error 1003
# response = requests.get("http://104.24.123.85/page")
# Correct - uses domain name
response = requests.get("https://example.com/page")
This simple change prevents the error in most cases.
Fixing a 1003 error code in monitors, webhooks, and cron jobs
Outside of scrapers, most 1003 error code reports come from background jobs that someone configured once and then forgot. An uptime monitor set up before the site moved to Cloudflare may still check the old origin IP. If that address now resolves to Cloudflare, or was copied from a DNS lookup of the domain, each check gets the 1003 response. The monitor then reports the site as down while real visitors load it without trouble.
To find the source, search your monitoring dashboards, webhook settings, CI variables, and crontab entries for numeric addresses. If you can access the Cloudflare dashboard, use the Ray ID from the failed response to locate that exact request in your logs. Replace each IP with the full domain URL, including https, and rerun the job. If a tool genuinely needs to reach the origin for health checks, give it a dedicated hostname so the request still carries a name your server can route.
Use Residential Proxies for Better Success Rates
When scraping at scale, rotating residential proxies help avoid detection and blocks. Services like Roundproxies.com offer residential, datacenter, ISP, and mobile proxies that route requests through legitimate IP addresses.
Proxies also distribute your requests across multiple IPs and reduce the chance of rate limiting.
Set Proper HTTP Headers
Always include a valid Host header matching the target domain:
headers = {
"Host": "example.com",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36"
}
response = requests.get("https://example.com/page", headers=headers)
Missing or incorrect Host headers trigger this error because the server can't determine which site you're requesting.
Preventing Error 1003 on Your Own Website
Site administrators can take proactive steps to minimize Error 1003 occurrences.
Hide Your Origin Server IP
Use services like Cloudflare's DNS-only setup combined with firewall rules that block all non-Cloudflare traffic. This makes your origin IP invisible to outside scanners.
Monitor Server Access Logs
Regularly check your web server logs for direct IP access attempts. Look for requests hitting your server's public IP rather than coming through Cloudflare.
These logs help identify misconfigured services or potential security probes targeting your infrastructure.
Keep Cloudflare IP Lists Updated
Cloudflare occasionally updates its IP ranges. If you've configured your firewall to only accept Cloudflare IPs, set up automated updates to avoid accidentally blocking legitimate traffic.
Conclusion
Error 1003 exists to enforce proper website access through domain names rather than direct IP connections. This security measure keeps traffic flowing through Cloudflare's proxy, where WAF rules and caching apply.
For administrators, the fix involves ensuring DNS records are proxied and configuring origin servers to accept only Cloudflare traffic. For visitors, simply using the correct domain name resolves the issue.
Understanding how HTTP Host headers and Cloudflare's proxy system work helps you troubleshoot this error quickly and prevent it from recurring.
FAQ
What does Cloudflare Error 1003 mean?
Cloudflare Error 1003 means your request attempted to access a website using its IP address directly instead of the domain name. Cloudflare blocks these requests so that traffic routes through its CDN, where firewall and caching rules apply.
Can I access a Cloudflare-protected site via its IP address?
No. Cloudflare intentionally blocks direct IP access to websites using its proxy service. You must use the registered domain name to access the site properly. This is a security feature, not a bug.
How do I find a website's real IP address behind Cloudflare?
Cloudflare hides origin server IPs to protect against direct attacks. While various historical DNS lookup tools exist, properly configured servers also block direct connections even if the IP becomes known.
Why does my web scraper get Cloudflare Error 1003?
Your scraper likely targets the server IP directly or sends requests without a proper Host header. Update your code to use the domain name and include correct HTTP headers with each request.