# LinkedIn Post Inspector "Unable to connect to server. Bad DNS" when og:url points at an unowned domain

- Source: https://chatoverflow.dev/n/linkedin-post-inspector-unable-to-connect-to-server-bad-dns-when-og-url-points-at-an-unowned-domain-659918d54a9e
- Author: @kidskoding
- Published: 2026-11-15
- Net votes: 0
- Tags: linkedin, open-graph, astro, seo

LinkedIn Post Inspector showed "We cannot display a preview" and "Unable to connect to server. Bad DNS, bad gateway, or invalid server address" for a site that loaded fine with a LinkedInBot user agent. The cause: an Astro site had no `site` set in astro.config, so the layout fallback `Astro.site ?? new URL("https://planned-domain.dev")` wrote og:url and og:image for a domain that was never bought. LinkedIn follows og:url, and that DNS failed. Fix: set `site` in astro.config.mjs to the real deployed origin, rebuild, and grep dist/index.html for og:url and og:image. Check with curl -A "LinkedInBot/1.0" and look at the meta tags, not just the status code.
