0% found this document useful (0 votes)
4 views3 pages

Nslookup, Dig, Nmcli Command

The document provides an overview of three command-line tools: nslookup, dig, and nmcli. Nslookup is used for finding IP addresses or DNS records for specific hostnames, while dig is a flexible tool for querying DNS information. Nmcli is the command-line interface for managing network connections on Ubuntu, offering various commands for checking network status and managing WiFi connections.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views3 pages

Nslookup, Dig, Nmcli Command

The document provides an overview of three command-line tools: nslookup, dig, and nmcli. Nslookup is used for finding IP addresses or DNS records for specific hostnames, while dig is a flexible tool for querying DNS information. Nmcli is the command-line interface for managing network connections on Ubuntu, offering various commands for checking network status and managing WiFi connections.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

nslookup command

The name server lookup (nslookup) command-line tool finds the internet
protocol (IP) address or domain name system (DNS) record for a specific
hostname. This command also supports reverse DNS lookups by inputting
the IP addresses of the domains to be looked up.

nslookup is a command-line tool to discover the IP address or DNS record


of a specific domain name. It also allows for reverse DNS lookup, letting you
find the domain attached to an IP address. To use the tool, enter “nslookup”
into the Command Prompt or Terminal.

The primary purpose of nslookup is to retrieve detailed information about the


specified domain. This information is essential for troubleshooting DNS-
related problems.
For example, your website is not working, and you want to check if the host
server is reachable by pinging it. Use the following command to send a
lookup request for the IP address:

nslookup domain_name

Dig Command in Linux


Dig (Domain Information Groper) is a powerful command-line tool for querying
DNS name servers. It is part of the BIND (Berkeley Internet Name Domain) suite
of DNS utilities.

The dig command allows you to query information about various DNS records,
including host addresses, mail exchanges, name servers, and more. It is the most
commonly used tool among system administrators for troubleshooting DNS
problems because of its flexibility and ease of use.

Syntax

dig domain_name
nmcli command
nmcli is the command-line interface for NetworkManager, and it's the most
capable tool for managing network connections on Ubuntu from a terminal. It
can do everything the GUI network settings can do, plus scripting-friendly
output, connection profiles, and more advanced configuration options.
Basic nmcli Usage
# Show NetworkManager status and all connections at a glance
nmcli
# Show connection status (cleaner summary)
nmcli connection show
# Show device status (interfaces and their state)
nmcli device status
# Show detailed device information
nmcli device show
# Show only a specific device
nmcli device show wlan0

Checking Network Status


# Overall network connectivity status
nmcli networking connectivity
# Possible values:
# none - no connection
# portal - captive portal, not yet authenticated
# limited - connected but no internet
# full - connected with internet access
# unknown - status unknown
# Check if networking is enabled
nmcli networking
# Check if WiFi is enabled
nmcli radio wifi
# Check all radio status
nmcli radio
WiFi Operations
Scanning and Connecting
# Scan for available WiFi networks
nmcli device wifi list
# Refresh the scan
nmcli device wifi rescan
nmcli device wifi list
# Connect to a WiFi network (creates a connection profile)
nmcli device wifi connect "NetworkName" password "yourpassword"
# Connect on a specific interface (when you have multiple WiFi adapters)
nmcli device wifi connect "NetworkName" password "yourpassword" ifname wlan0
# Connect to a hidden network
nmcli device wifi connect "HiddenSSID" password "yourpassword" hidden yes

Managing WiFi Radio


# Disable WiFi (useful for troubleshooting or power saving)
nmcli radio wifi off
# Re-enable WiFi
nmcli radio wifi on
# Turn off all radios (WiFi + Bluetooth + WiMAX)
nmcli radio all off
nmcli radio all on

You might also like