コンテンツにスキップ
Zidooka

“dig” Command Not Found on Windows? Use “nslookup” Instead to Check DNS Records

When verifying DNS records for server migration or Google Search Console ownership, many technical tutorials suggest using the dig command. However, if you try to run dig on a standard Windows environment (Command Prompt or PowerShell), you will likely encounter an error:

dig : The term 'dig' is not recognized as the name of a cmdlet, function, script file, or operable program.

This is because dig is not installed by default on Windows. Instead, you should use the built-in nslookup command.

Basic Usage of nslookup

nslookup allows you to query DNS servers for IP addresses or specific DNS records.

Checking Specific Records (e.g., TXT)

To check a "TXT record" (often used for domain verification), you need to specify the record type.

One-liner example:

nslookup -type=TXT sub.example.com
  • -type=TXT: Specifies the record type (A, CNAME, MX, TXT, etc.).
  • sub.example.com: The domain name you want to check.

Note for PowerShell Users: Sometimes PowerShell may not interpret arguments like -type=TXT correctly. In that case, try nslookup -q=TXT sub.example.com or use the interactive mode described below.

Type nslookup and press Enter to enter interactive mode.

Step 1: Start nslookup

nslookup

Step 2: Set record type

set type=TXT

(Use set type=A for A records, set type=CNAME for CNAME records)

Step 3: Enter domain

sub.example.com

The result will be displayed.

Step 4: Exit

exit

Understanding the Output

If successful, you will see output similar to this:

Server:  UnKnown
Address:  192.168.1.1

Non-authoritative answer:
sub.example.com text =

        "google-site-verification=xxxxxxxxxxxxxxxx"

The text following text = is the value currently returned by the DNS server. If your configured value appears here, DNS propagation is complete.

Summary

If you can't find the dig command on Windows, simply use nslookup. Remember to use set type=TXT (or -type=TXT) when checking verification records.

この記事についてAIに相談

記事のURL・タイトル・冒頭部分を渡して、新しいチャットを開きます。

送信前に、各サービスの入力欄で内容を確認できます。

※ 専門的な知見として評価する / Rate as expert insight
Twitter Facebook

ZIDOOKA!

Zidookaは20代のフリーランスエンジニア(関西在住)が運営しています。業務の自動化やHP制作のご相談も、小さなことから気軽にどうぞ。

About Zidooka

Zidooka is run by a freelance engineer in his twenties based in Kansai, Japan. Feel free to get in touch about workflow automation or website development, even for small requests.

投稿数 / Posts: 1019
── 最後まで読んでいただきありがとうございます / Thank you for reading ──
📮

この記事で解決しなかった点があれば以下をコメントください / If unresolved, please comment:

  • 発生した画面 / Screen
  • 実行した手順 / Steps
  • 出たエラーメッセージ / Error Message
また、個別サポートをご希望の場合は / For individual support:
main@zidooka.com(Contact: Yamaguchi)までご連絡ください。
▶ 次に読まれている関連記事 / Next Recommended Read:
Taildrop is ridiculously convenient for moving files between your devices

Leave a Comment

Your email address will not be published. Required fields are marked *