If you want to do a DNS lookup using Mac Terminal, you can make use of the nslookup command.
nslookup - query Internet name servers interactively
Let's take a look at an example.
% nslookup code2care.org Server: 192.168.0.1 Address: 192.168.0.1#53 Non-authoritative answer: Name: code2care.org Address: 184.108.40.206 Name: code2care.org Address: 220.127.116.11
As you may see, code2care.org resolves to IP addresses (two DNS addresses) 18.104.22.168 and 22.214.171.124
% nslookup google.com Server: 192.168.0.1 Address: 192.168.0.1#53 Non-authoritative answer: Name: google.com Address: 126.96.36.199
This is not an AI-generated article but is demonstrated by a human on an M1 Mac running macOS Sonoma 14.0.
Please support independent contributors like Code2care by donating a coffee.
Buy me a coffee!
Facing issues? Have Questions? Post them here! I am happy to answer!
- Clear Screen shortcut macOS Terminal
- What is macOS Ventura?
- [fix] How to Show file extensions on all files on Mac
- How to Find Where Mac Terminal App is Located?
- AutoSave button not working on Office on Mac (Word, Excel or Powerpoint)
- macOS say command text to speech using various voices and languages
- How to change Ping TTL value on macOS
- Open .bash_profile File in TextEdit using Terminal
- How to know the Safari Version on Mac
- How to Copy full Absolute Path of a File on Mac
- 13.0 MacOS Ventura release date
- Enable spell check in Sublime Text (macOS)
- How to Display Analog Clock on Mac Menu Bar
- How to turn off Location Services macOS Ventura 13
- How to Open VS Code on Mac
- Add Bookmark macOS Safari
- How to Fix cd: too many arguments Error in Terminal: A Step-by-Step Guide
- How to install wget on macOS
- Select Line Number TextEdit on Mac
- Strikethrough Text in Excel for Mac
- How to Enable or Disable Dark Mode on macOS Ventura 13
- How to hide or display Wifi icon in macOS Bug Sur Menu Bar
- How to install Yarn on Mac (macOS)
- How to fix command not found brew (bash, zsh) on macOS Terminal
- How to Schedule Mails in macOS Ventura
- Python Hello World! Program with code example (snippet) - Python
- Mac - Chrome Open a new window in Incognito mode - Chrome
- Mac: How to Insert a Row in Excel - Microsoft
- Java: Convert String to Binary - Java
- Zsh Shell: Custom alias that you may find useful - MacOS
- Fix: KeyError: exception in Python - Python
- Cannot create new Microsoft Team using PowerShell, even as Admin - Teams
- Fix: TypeError: set object is not subscriptable - Python