11001010110001101010
Module 4 - Linux OS
Chapter 4.5 - Linux Commands 1
11001010101010
11001010101010
● Nslookup
● Services
● Netstat
03 July 2023
[Link]
1
11001010110001101010
11001010110001101010
Nslookup
Nslookup (stands for “Name Server Lookup”) is a useful command for getting information from the
DNS server. It is a network administration tool for querying the Domain Name System (DNS) to
obtain domain name or IP address mapping or any other specific DNS record. It is also used to
troubleshoot DNS-related problems.
11001010101010
11001010101010
2
11001010110001101010
11001010110001101010
Nslookup
● Performing a reverse DNS lookup
nslookup [IP Address]
● Lookup for any record
11001010101010
11001010101010
We can also view all the available DNS records using
the -type=any option.
Using `-type=any` option
● Lookup for a soa record
SOA record (start of authority), provides the
authoritative information about the domain, the
e-mail address of the domain admin, the domain
serial number, etc…
nslookup -type=soa google..com
3
11001010110001101010
11001010110001101010
Nslookup
● Lookup for an ns record.
NS (Name Server) record maps a domain name to
a list of DNS servers authoritative for that
11001010101010
11001010101010
domain. It will output the name serves which are
associated with the given domain.
Using `-type=ns` option
nslookup -type=ns [Link]
4
11001010110001101010
11001010110001101010
Nslookup
● Lookup for a record.
We can also view all the available DNS records for a particular record
using the -type=a option
11001010101010
11001010101010
nslookup -type=a [Link]
● Lookup for an mx record.
MX (Mail Exchange) maps a domain name to a list of mail exchange
servers for that domain. The MX record says that all the mails sent
to “[Link]” should be routed to the Mail server in that domain.
nslookup -type=mx [Link]
5
11001010110001101010
11001010110001101010
Nslookup
● Lookup for a txt record.
TXT records are a type of Domain Name System
(DNS) record in text format, which contain
11001010101010
11001010101010
information about your domain. TXT records also
have information that helps external network
servers and services handle outgoing email from
your domain.
You can find all TXT records configured for any
domain using the command below.
nslookup -type=txt [Link]
6
11001010110001101010
11001010110001101010
Conclusion
● The `nslookup` command which is a variable tool
for querying the DNS server and obtaining
information about domain name or IP address
mapping.
11001010101010
11001010101010
● It is very useful for troubleshooting DNS-related
issues. We have also discussed options like
-type=a, -type=any, -type=mx, -type=ns, -type=ptr,
and -type=soa.
● By using nslookup information, administrators can
gain insights into the DNS infrastructure and
resolve DNS-related problems efficiently.
7
11001010110001101010
11001010110001101010
Listing Linux Running Services
● To display the status of all available services at once
in the System V (SysV) init system, run the service
command with the --status-all option:
#service --status-all
11001010101010
11001010101010
● Run the following command to see only running
services in the system.
#service --status-all | grep running
● Run the following command to see the specified
service status.
#service --status-all | grep httpd
● Determine the current status of a particular
service, execute the following command.
# service httpd status
8
11001010110001101010
11001010110001101010
Netstat
Linux netstat command stands for Network statistics. It displays information about different interface
statistics, including open sockets, routing tables, and connection information. Further, it can be used
to displays all the socket connections (including TCP, UDP).
11001010101010
11001010101010
9
11001010110001101010