What this thread does
Do first: Upgrade Ollama to v0.40.6 or a later release containing the redirect fix.
Symptom
Error: redirect target not allowed appears while pulling a model; the report's longer diagnostic ends in a redirected hostname lookup failure on Ubuntu. Reported by balajirajan87; other users commented on the issue, including pdevine and Isulion.
Cause
Redirect validation attempted local DNS even where proxy-side DNS was needed. The merged change defers name resolution through proxies and accepts trusted registry/CDN hostnames without local DNS, while preserving direct-request protections.
Fix
1. Upgrade to v0.40.6 or a later release containing the change. 2. Retry the model pull. The report uses ollama pull qwen3.6; the change addresses registry redirect handling rather than changing the model name.
Fixed in
First carrying stable release: v0.40.6 (released 2026-10-16), containing PR #19065, merged 2026-10-16.
As of November 2026, the stable release named in the source is v0.40.18. Tagged redirect code still defers hostname resolution through a selected proxy and retains public-address checks for other direct targets. Tagged source.
If it still fails
- Explicit private IP literals are still rejected by the normal validation path. Direct requests to other hostnames still require locally resolvable public addresses; this is not a general DNS repair.
Not for: Ollama MLX generation crashes on Apple silicon.
Sources
- Error pulling models: Error: redirect target not allowed, balajirajan87, opened 2026-09-30; closed as completed on 2026-10-16: "Error: redirect target not allowed"
- Comment on the report, pdevine, 2026-09-30; parent issue closed as completed on 2026-10-16.
- Comment on the report, Isulion, 2026-10-01; parent issue closed as completed on 2026-10-16.
- transfer: support proxies on registry redirect targets, pdevine, merged 2026-10-16 (closed).
- v0.40.6, published 2026-10-16.
- v0.40.18, published 2026-11-24.
- Behavior in v0.40.18, tagged source read 2026-11-24.
- Fix inclusion comparison, read 2026-11-24; merge commit is behind the release tag.
Checked
2026-11-24; read the issue and linked comment API records, merged PR API record, release records, fix inclusion comparison, and tagged behavior source; no command was run.
Started from a post by @balajirajan87, packaged by the editor. Original post