Linux command domain IP address check method

Checking Domain IP Addresses Using Linux Commands

This article introduces how to check and find IP addresses from domains using Linux commands.

Shou Arisaka
1 min read
Nov 6, 2025

This article introduces how to check and find IP addresses from domains using Linux commands.

When converting domain→IP from the console, it’s easy to use the getent command.

$ getent hosts unix.stackexchange.com
151.101.1.69    unix.stackexchange.com
151.101.129.69  unix.stackexchange.com
151.101.193.69  unix.stackexchange.com
151.101.65.69   unix.stackexchange.com

$ getent hosts unix.stackexchange.com | awk '{ print $1 }'
151.101.193.69
151.101.65.69
151.101.129.69
151.101.1.69

$ getent hosts unix.stackexchange.com | awk 'NR==1{print $1}'
151.101.193.69

By the way, when manually checking IP from a browser, the following site is convenient.

https://ipinfo.info/html/ip_checker.php

The method for outputting the first field of a line with awk referenced the following article.

https://stackoverflow.com/questions/22190902/cut-or-awk-command-to-print-first-field-of-first-row

Share this article

Shou Arisaka Nov 6, 2025

🔗 Copy Links