Internet Specific Commands

Welcome to my blog series on Linux Internet Commands! In this comprehensive series, we will dive into the world of essential commands that empower you to interact with the internet effectively on your Linux system. We will explore the versatile tools like ping, wget, dig, and curl, uncovering their functionalities, and showcasing practical examples of their usage.

Whether you are a beginner looking to enhance your Linux skills or a seasoned user seeking to expand your knowledge, this series is the perfect resource for you. We will provide clear explanations, step-by-step tutorials, and useful tips and tricks to help you master these powerful Linux Internet commands.

By the end of this series, you will have a solid understanding of how to utilize ping to troubleshoot network connectivity, harness the power of wget to download files and webpages with ease, leverage dig to perform advanced DNS queries, and harness the versatility of curl to interact with various protocols and APIs.

So, if you’re ready to unlock the full potential of Linux Internet commands and take your internet-related tasks to the next level, join us on this exciting journey through the blog series on Linux Internet Commands. Let’s dive in and explore the vast possibilities together!

  • ping: Send ICMP ECHO_HOSTS to network hosts. It is generally used to check connectivity between your local machine and remote host or IP address.

    Basic Syntax: ping [OPTIONS] HOST

    • Commonly used flags:
      • -4: Use ipv4 only
      • -6: Use ipv6 only
      • -c: Stop after sending specified counts.
      • -I: Specify the interface.
      • -n: Numeric output only
    • Example:
    ping -I ens33 google.com
    #result
    PING google.com (142.250.192.174) from 192.168.179.128 ens33: 56(84) bytes of data.
    64 bytes from del11s11-in-f14.1e100.net (142.250.192.174): icmp_seq=1 ttl=128 time=23.4 ms
    64 bytes from del11s11-in-f14.1e100.net (142.250.192.174): icmp_seq=2 ttl=128 time=21.3 ms
    
    ----------------
    ping -c 1 google.com
    PING google.com (142.250.192.174) 56(84) bytes of data.
    64 bytes from del11s11-in-f14.1e100.net (142.250.192.174): icmp_seq=1 ttl=128 time=71.7 ms
    
    --- google.com ping statistics ---
    1 packets transmitted, 1 received, 0% packet loss, time 0ms
    rtt min/avg/max/mdev = 71.735/71.735/71.735/0.000 ms
  • host: It is a simple DNS lookup utility which performs lookup on internet address.

    Basic Syntax: host [OPTIONS] HOSTNAME

    • Commonly used flags:
      • -4: Perform DNS lookup to retrieve ipv4 address associated with the hostname.
      • -6: Perform DNS lookup to retrieve ipv6 address associated with the hostname.
      • -d: Print debugging traces
      • -W [time_in_seconds]: Wait for upto given seconds.
    • Example:

    host -4d google.com
    #Result
    ;; QUESTION SECTION:
    ;google.com.                    IN      A
    
    ;; ANSWER SECTION:
    google.com.             5       IN      A       142.250.192.174
    
    Received 44 bytes from 127.0.0.53#53 in 12 ms
    Trying "google.com"
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 47472
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
    
    ;; QUESTION SECTION:
    ;google.com.                    IN      AAAA
    
    Received 28 bytes from 127.0.0.53#53 in 8 ms
    Trying "google.com"
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 64465
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
    
    ;; QUESTION SECTION:
    ;google.com.                    IN      MX
    
    ;; ANSWER SECTION:
    google.com.             5       IN      MX      10 smtp.google.com.
    
    Received 49 bytes from 127.0.0.53#53 in 8 ms
  • dig: Utility to perform DNS lookups and displays the answers that are returned from the name servers.

    Basic Syntax: dig [OPTIONS] HOSTNAME

    • Commonly used flags
      • -x: Find out the domain name associated with given ip
      • [domain_name]: Display various DNS records associated with the specified domain.
      • @[dns_server] : Send query to specified dns server
      • +short: Display only the IP address
    • Example:
    dig -x 98.137.11.164
    #result
    ; <<>> DiG 9.16.1-Ubuntu <<>> -x 98.137.11.164
    ;; global options: +cmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 25747
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
    
    ;; OPT PSEUDOSECTION:
    ; EDNS: version: 0, flags:; udp: 65494
    ;; QUESTION SECTION:
    ;164.11.137.98.in-addr.arpa.    IN      PTR
    
    ;; ANSWER SECTION:
    164.11.137.98.in-addr.arpa. 5   IN      PTR     media-router-fp73.prod.media.vip.gq1.yahoo.com.
    
    ;; Query time: 564 msec
    ;; SERVER: 127.0.0.53#53(127.0.0.53)
    ;; WHEN: Tue Jun 06 07:16:08 UTC 2023
    ;; MSG SIZE  rcvd: 115
    
    -----------------------------------
    dig +short secnep.com
    #results
    173.249.56.96

  • curl: curl is a tool to transfer data from or to a server, using one of the supported protocols (DICT, FILE, FTP, FTPS, GOPHER, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET and TFTP). The command is designed to work without user interaction.

    Basic Syntax: curl [OPTIONS] URL

    • Commonly used flags
      • -o: Output file for the response
      • -L: Follow redirection
      • —dns-servers: Use different DNS server
      • -k: Allow insecure connections
    • Example:
    curl -ko test.txt https://google.com
    #result
    % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100   220  100   220    0     0    397      0 --:--:-- --:--:-- --:--:--   397
    
  • wget: Non-interactive download of files from the web which supports HTTP, HTTPS, and FTP protocols.

    Basic Syntax: wget [OPTIONS] URL

    • Commonly used flags:
      • -O: Specify output file
      • —no-check-certificate:
    • Example:
    wget -O resp.txt https://hihey.local
Leave a Reply 2

Your email address will not be published. Required fields are marked *


acheteriptvabonnement

acheteriptvabonnement

you are in reality a just right webmaster The site loading velocity is incredible It seems that you are doing any unique trick In addition The contents are masterwork you have performed a wonderful task on this topic

8171ehsaasnews.

8171ehsaasnews.

Hi i think that i saw you visited my web site thus i came to Return the favore Im attempting to find things to enhance my siteI suppose its ok to use a few of your ideas