DNS Resolution Issue: `nslookup` Works But `curl` Fails
21:19 03 Nov 2025

What I Want to Do

Install ESLint and related dependencies using pnpm in my TypeScript React frontend project (part of a Wails Go + TypeScript hybrid application).

What I Did

  1. Ran pnpm add --save-dev eslint@latest to install ESLint
  2. Verified DNS resolution with nslookup registry.npmjs.org — it works perfectly
  3. Attempted to verify connectivity with curl -I https://registry.npmjs.org

The Error I Got

pnpm error:

ERR_PNPM_META_FETCH_FAIL  GET https://registry.npmjs.org/eslint: request to https://registry.npmjs.org/eslint failed, reason: getaddrinfo ENOTFOUND registry.npmjs.org

curl error:

curl: (6) Could not resolve host: registry.npmjs.org

Key Observation (Inconsistency)

nslookup WORKS:

Name:   registry.npmjs.org
Address: 104.16.29.34
Address: 104.16.31.34
Address: 104.16.27.34
[...and 9 more IPv4 addresses]

But curl FAILS:

curl: (6) Could not resolve host: registry.npmjs.org

Environment

  • OS: macOS (Intel-series)
  • Node: 24.x
  • Package Manager: pnpm
  • Project: Wails v2.10.2 (Go 1.25.3 backend + TypeScript React frontend)

What I've Tried

  • Basic DNS check: nslookup registry.npmjs.org :white_check_mark: (resolves)
  • Connectivity test: curl -I https://registry.npmjs.org :x: (fails to resolve)
  • pnpm store prune (still fails)
  • Multiple pnpm add attempts (all fail with same error)

Question

Why does nslookup successfully resolve registry.npmjs.org but curl reports it cannot resolve the host? What's causing this DNS inconsistency, and how can I fix it so pnpm can download packages?

macos npm dns pnpm