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: 126.96.36.199 Name: code2care.org Address: 188.8.131.52
As you may see, code2care.org resolves to IP addresses (two DNS addresses) 184.108.40.206 and 220.127.116.11
% nslookup google.com Server: 192.168.0.1 Address: 192.168.0.1#53 Non-authoritative answer: Name: google.com Address: 18.104.22.168
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!
- How to Display Analog Clock on Mac Menu Bar
- Shutdown Mac Terminal Command
- How to know the Serial Number of MacBook on macOS Ventura 13.0
- macOS: Remove Desktop or Documents Folder from iCloud Drive Syncing
- [fix] How to Show file extensions on all files on Mac
- How to install Zoom Add-in to Outlook (Mac)
- How to turn off Stage Manager - macOS Ventura
- Fix - Xode - Internal logic error: Connection was invalidated
- How to do calculations in Mac Terminal
- How to delete a Page in Microsoft Word File on Mac (macOS)
- How to Refresh Mac Desktop
- How to install Java on macOS [Big Sur]
- How to Disable Mac Terminal Bell Sound
- Installing MongoDB on Linux/Unix/macOS/Ubuntu
- How to Uninstall Brew on Mac
- Find your macOS version
- Change TextEdit File Encoding
- AppleScript Example with TextEdit
- How to install homebrew (brew) on M1 Mac
- How to Find File and Directory Size in Mac Terminal
- How to open new tab in Sublime Text Editor [macOS]
- How to list all users in Mac Terminal
- Turn off Auto-Capitalization on macOS Ventura 13
- How to check Command Line Tools Version [Updated for Ventura]
- Change Current User Password using Mac Terminal Command
- Java 8 Predicate default and() function Example - Java
- StringJoiner Example with Java Collections - Java
- Java 8: Steam map with Code Examples - Java
- How to display hidden files in Eclipse (dot prefixed files) - Eclipse
- Installing MongoDB on Linux/Unix/macOS/Ubuntu - MacOS
- How to Change AWS Default Region using CLI - AWS
- Android SecurityException: Need BLUETOOTH ADMIN permissicacheNameAndAddresson: Neither user 10123 nor current process has android.permission.BLUETOOTH_ADMIN - Android