Make a curl or wget request to the checkip.amazonaws.com and it prints the public IP address of your computer. You can also connect to Akamai’s whatismyip.akamai.com domain get your external IP address.
Your computer has a private IP address that only work within the local network. For older Macs with a wired Ethernet port, use en0 for Ethernet interface or en1 for the WiFi interface.
Print a list all network interfaces available on your machine.
The free ‘ip2c’ service resolves an IP address to the country. Or, use ipapi to get more details of an IP address including the city name, timezone and even the latitude and longitude associated with an IP address.
The Mail Exchange (MX) records specify the incoming mail servers that used for delivering email messages sent to your domain name.
Get a list of all DNS records of a domain including TXT records, MX records and name servers. The name servers handle queries regarding the location of the domain’s website, email and other services.
Use dig to find the IP address of a website. Use the dig command to perform a reverse lookup to find the host of that IP address.
Use whois to reveal information about any web domain including the date when it was first registered, the contact details of the owner, the expiration date of the domain, the name of the domain registrar and so on.
Use that IP address in the next command to get the hostname.
The ping command helps you test if a remote host is reachable and whether your machine can connect to it properly. The above command pings the host 5 time and there’s a 2 second wait between pings.
If your Internet connection is working but you are unable to reach a website, there could be an issue with an intermediate router that the packets have to pass through to reach the server. Traceroute prints the network path from your local computer to the website that the traffic must pass through.