In Linux, I would use dig
to specify a DNS server of 127.0.0.1 with the following command:
dig google.com @127.0.0.1
I installed Bind tools for windows (choco install bind-toolsonly
). How can I run that same command? I get the following error:
PS C:\Users\jhilden> dig google.com @127.0.0.1 At line:1 char:21 + dig google.com @127.0.0.1 + ~ Missing property name after reference operator. At line:1 char:16 + dig google.com @127.0.0.1 + ~~~~ The splatting operator '@' cannot be used to reference variables in an expression. '@127' can be used only as an argument to a command. To reference variables in an expression use '$127'. + CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException + FullyQualifiedErrorId : MissingPropertyName
Under Nameservers, select the server that you want to use for the DNS query. You can use the default name server, or select a specific DNS server, like OpenDNS or Google. Click Dig. The page displays the results from dig, as well as the actual dig command used.
The dig command (Domain Information Groper) is a popular Linux utility used for performing DNS lookups. It provides more flexibility than Windows NSLookup but, unfortunately, it isn't available in Windows 10 by default. One option for using dig on Windows is to install BIND.
Go to Start and type cmd in the search field to open the command prompt. Alternatively, go to Start > Run > type cmd or command. Type nslookup and hit Enter. The displayed information will be your local DNS server and its IP address.
To find the authoritative name-server for a domain name, we first need to access the corresponding SOA record. To do so, we can use nslookup. It's a command-line tool for querying Internet domain name servers. There, we see that the primary name server for google.com is ns1.google.com.
I know this answer doesn't use Bind tools, as you inferred in your question. That said, however, PowerShell comes with the Resolve-DnsName
to perform this task. I believe that the following command will do what you are after
Resolve-DnsName -Name google.com -Server 127.0.0.1
Like the error message says: the @
has a special meaning in PowerShell. Escape the character
dig google.com `@127.0.0.1
or put the argument in quotes
dig google.com "@127.0.0.1"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With