Skip to content

Instantly share code, notes, and snippets.

@icasimpan
Forked from CMCDragonkai/curl_custom_dns.sh
Created December 21, 2017 21:58
Show Gist options
  • Save icasimpan/c6d5e240c8a180cc955227562c82d35d to your computer and use it in GitHub Desktop.
Save icasimpan/c6d5e240c8a180cc955227562c82d35d 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 <dns.ip,dns.ip> url.com
# acquire the nameserver using
dig url.com NS
# then ping the NS to get its IP address
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment