Dig Without Cache

dig can return cached responses because it caches the results of previous queries to improve performance.

For the same reason the cache responses can come from the configured name servers.

This is useful when you are querying the same domain multiple times, but it can be problematic when you need to check if a change you made to a DNS record has propagated.

Luckily, the dig command can be forced to resolve without using cache and this post demonstrates how to do this. (more…)

TCPDump Examples – 30 Best Commands Ever!

tcpdump is a command-line network packet analyzing tool, that is absolutely essential for troubleshooting networking issues.

It is used to display network packets transmitted over network interfaces connected to the system on which tcpdump is installed.

tcpdump has a large set of flags and arguments used to specify various options, which can be pretty overwhelming for beginners.

Below you will find a collection of the best examples of the tcpdump command. (more…)

IPv6 Ping – How to Ping an IPv6 Address in Windows

An IPv6 is a preferred protocol over IPv4 in modern Windows and Linux systems.

In Windows, you can ping IPv6 addresses using a standard ping command.

If the ping command fails to ping the IPv6 address, it could be that the IPv6 protocol is disabled or it is not supported by your computer or the router it is connected to, or by your ISP (Internet Service Provider).

This short note shows how to ping the IPv6 addresses in Windows and how to check if the IPv6 protocol is enabled. (more…)

What Is My Router’s IP Address (Default Gateway)

A router is a device that communicates between the Internet (or public network) and the devices in a local network (or private network).

A typical home router, that usually acts as a default gateway for the local devices, can be configured using a web-based configuration page that can be accessed from a web-browser if you know the router’s IP address.

In this note i will show how to find out the router’s IP address in Windows, Linux and MacOS from the command line. (more…)

Disable IPv6 on Linux – Ubuntu, Debian, CentOS

To disable IPv6 on Linux it is required to modify Linux kernel parameters.

IPv6 can be temporary disabled at runtime, using sysctl command or it can be disabled permanently using either sysctl configuration file or the required kernel parameters can be passed at boot time using GRUB configuration.

In this note i am showing how to disable IPv6 temporary or permanently on Ubuntu, Debian, CentOS and similar Linux operating systems. (more…)

Finding Active Computers in Local Network from Linux

Searching for Linux command that can list all IP addresses of devices connected to the network?

Use nmap or ping commands to determine alive hosts in your local network.

[nmap] Scan Network for Alive Computers

Scan for active hosts on a network using nmap command:

# Standard ICMP ping
$ nmap -sn 192.168.1.0/24

Sample output:

Starting Nmap 6.00 ( http://nmap.org ) at 2013-06-14 00:52 EEST
Nmap scan report for 192.168.1.1
Host is up (0.0031s latency).
Nmap scan report for 192.168.1.101
Host is up (0.00097s latency).
Nmap scan report for 192.168.1.102
Host is up (0.065s latency).
Nmap done: 256 IP addresses (3 hosts up) scanned in 2.98 seconds

[ping] Find Active Hosts in LAN

Use the following script to find out what computers in your local network respond to ping:

$ echo 192.168.1.{1..254}|xargs -n1 -P0 ping -c1|grep "bytes from"

Sample output:

64 bytes from 192.168.1.101: icmp_req=1 ttl=64 time=0.042 ms
64 bytes from 192.168.1.1: icmp_req=1 ttl=64 time=37.4 ms
64 bytes from 192.168.1.102: icmp_req=1 ttl=64 time=208 ms

Discover Computers Behind a Firewall

Some hosts may have a firewall, and will not respond to standard ICMP pings.

If a firewall is blocking standard ICMP pings, try the following host discovery methods:

# TCP SYN Ping
$ nmap -sn -PS 192.168.1.0/24

# TCP ACK Ping
$ nmap -sn -PA 192.168.1.0/24

# UDP Ping
$ nmap -sn -PU 192.168.1.0/24

# IP Protocol Ping
$ nmap -sn -PO 192.168.1.0/24

# ARP Ping
$ nmap -sn -PR 192.168.1.0/24

Last three commands should be executed with root credentials.