Skip to content

Instantly share code, notes, and snippets.

@CMCDragonkai
Last active August 18, 2023 12:00
Show Gist options
  • Star 31 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save CMCDragonkai/48b0ec28c5325b1d815f to your computer and use it in GitHub Desktop.
Save CMCDragonkai/48b0ec28c5325b1d815f to your computer and use it in GitHub Desktop.
cURL: Selecting a custom DNS server to resolve domain names
#!/usr/bin/env bash
# this can be useful when developing against a custom DNS server, or
# for example, if you made a change to the DNS settings of a domain, and you
# know the authoritative nameserver IP address for a domain, you could use this
# to bypass the intermediate DNS cache, and apply an HTTP request using the new
# DNS settings supplied by your specified (authoritative) nameserver
curl --dns-servers <DNSIP,DNSIP> url.com
# acquire the authoritative nameserver IP using
dig url.com NS
# then ping the NS to get its IP address
# you can also directly resolve
curl \
--resolve www.example.com:443:198.14.3.5 \
https://www.example.com \
--verbose
@paxperscientiam
Copy link

MacPorts

thanks @patrick-webs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment