Narzędzia diagnostyczne w sieciach komputerowych

  1. Diagnostyka DNS
  2. host

    bash-3.2$ host -t MX asl24.pl
    asl24.pl mail is handled by 5 150.254.78.79.asl24.pl.
    asl24.pl mail is handled by 10 150.254.78.79.asl24.pl.
    bash-3.2$ host -t NS asl24.pl
    asl24.pl name server ns2.asl24.pl.
    asl24.pl name server ns1.asl24.pl.
    bash-3.2$ host -t A asl24.pl
    asl24.pl has address 150.254.78.79
    bash-3.2$ host -t AAAA asl24.pl
    asl24.pl has IPv6 address ::1
    bash-3.2$ host www.asl24.pl
    www.asl24.pl has address 150.254.78.79
    bash-3.2$
    

    nslookup

    test:~# nslookup
    > asl24.pl
    Server:         150.254.78.2
    Address:        150.254.78.2#53
    
    Non-authoritative answer:
    Name:   asl24.pl
    Address: 150.254.78.79
    > server localhost
    Default server: localhost
    Address: 127.0.0.1#53
    Default server: localhost
    Address: ::1#53
    > asl24.pl
    Server:         localhost
    Address:        127.0.0.1#53
    
    Name:   asl24.pl
    Address: 150.254.78.79
    > set type=any
    > asl24.pl
    Server:         localhost
    Address:        127.0.0.1#53
    
    asl24.pl
            origin = asl24.pl
    	mail addr = root.asl24.pl
    	serial = 5
    	refresh = 604800
    	retry = 86400
    	expire = 2419200
    	minimum = 604800
    asl24.pl        nameserver = ns1.asl24.pl.
    asl24.pl        nameserver = ns2.asl24.pl.
    Name:   asl24.pl
    Address: 150.254.78.79
    asl24.pl        mail exchanger = 10 150.254.78.79.asl24.pl.
    asl24.pl        mail exchanger = 5 150.254.78.79.asl24.pl.
    asl24.pl        has AAAA address ::1
    > set type=mx
    > asl24.pl
    Server:         localhost
    Address:        127.0.0.1#53
    asl24.pl        mail exchanger = 5 150.254.78.79.asl24.pl.
    asl24.pl        mail exchanger = 10 150.254.78.79.asl24.pl.
    > exit
    
    test:~#
    

    whois

    bash-3.2$ whois asl24.pl
    
    DOMAIN NAME:           asl24.pl
    registrant type:       organization
    nameservers:           ns2.asl24.pl. [150.254.78.79]
                           ns1.asl24.pl. [150.254.78.79]
    		       created:               2011.12.12 19:18:48
    		       last modified:         2011.12.12 19:31:34
    		       renewal date:          2012.12.12 19:18:48
    
    no option
    
    
    
    REGISTRAR:
    Home.pl sp. z o.o.
    (dawniej Home.pl Jurczyk, Stypula, Kapcio sp.j)
    pl. Rodla 9
    70-419 Szczecin
    Polska/Poland
    +48.914325555
    +48.801445555
    info@home.pl
    
    WHOIS displays data with a delay not exceeding 15 minutes in relation to the .pl Registry system
    Registrant data available at http://dns.pl/cgi-bin/en_whois.pl
    bash-3.2$
    

    dnstracer - narzędzie do śledzenia wywołać zapytań DNS

    test:~# dnstracer -o www.asl24.pl
    Tracing to www.asl24.pl[a] via 150.254.78.2, maximum of 3 retries
    150.254.78.2 (150.254.78.2)
     |\___ ns2.asl24.pl [asl24.pl] (150.254.78.79) Got authoritative answer
      \___ ns1.asl24.pl [asl24.pl] (150.254.78.79) (cached)
       
    ns2.asl24.pl (150.254.78.79)            www.asl24.pl -> 150.254.78.79
    test:~#
    

    DIG to narzędzie do wyszukiwań DNS

    test:~# dig asl24.pl
    
    ; <<>> DiG 9.5.1-P3 <<>> asl24.pl
    ;; global options:  printcmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 15607
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2
    
    ;; QUESTION SECTION:
    ;asl24.pl.                      IN      A
    
    ;; ANSWER SECTION:
    asl24.pl.               419297  IN      A       150.254.78.79
    
    ;; AUTHORITY SECTION:
    asl24.pl.               86100   IN      NS      ns1.asl24.pl.
    asl24.pl.               86100   IN      NS      ns2.asl24.pl.
    
    ;; ADDITIONAL SECTION:
    ns1.asl24.pl.           604500  IN      A       150.254.78.79
    ns2.asl24.pl.           604500  IN      A       150.254.78.79
    
    ;; Query time: 0 msec
    ;; SERVER: 150.254.78.2#53(150.254.78.2)
    ;; WHEN: Tue Feb 14 18:54:35 2012
    ;; MSG SIZE  rcvd: 110
    
    test:~#
    
    test:~# dig +trace asl24.pl
    
    ; <<>> DiG 9.5.1-P3 <<>> +trace asl24.pl
    ;; global options:  printcmd
    .                       96304   IN      NS      l.root-servers.net.
    .                       96304   IN      NS      b.root-servers.net.
    .                       96304   IN      NS      h.root-servers.net.
    .                       96304   IN      NS      j.root-servers.net.
    .                       96304   IN      NS      c.root-servers.net.
    .                       96304   IN      NS      f.root-servers.net.
    .                       96304   IN      NS      k.root-servers.net.
    .                       96304   IN      NS      g.root-servers.net.
    .                       96304   IN      NS      d.root-servers.net.
    .                       96304   IN      NS      a.root-servers.net.
    .                       96304   IN      NS      m.root-servers.net.
    .                       96304   IN      NS      i.root-servers.net.
    .                       96304   IN      NS      e.root-servers.net.
    ;; Received 512 bytes from 150.254.78.2#53(150.254.78.2) in 0 ms
    
    pl.                     172800  IN      NS      i-dns.pl.
    pl.                     172800  IN      NS      h-dns.pl.
    pl.                     172800  IN      NS      g-dns.pl.
    pl.                     172800  IN      NS      d-dns.pl.
    pl.                     172800  IN      NS      a-dns.pl.
    pl.                     172800  IN      NS      f-dns.pl.
    pl.                     172800  IN      NS      e-dns.pl.
    pl.                     172800  IN      NS      c-dns.pl.
    ;; Received 398 bytes from 192.33.4.12#53(c.root-servers.net) in 23 ms
    
    asl24.pl.               86400   IN      NS      ns2.asl24.pl.
    asl24.pl.               86400   IN      NS      ns1.asl24.pl.
    ;; Received 94 bytes from 217.17.46.189#53(f-dns.pl) in 60 ms
    
    asl24.pl.               604800  IN      A       150.254.78.79
    asl24.pl.               604800  IN      NS      ns2.asl24.pl.
    asl24.pl.               604800  IN      NS      ns1.asl24.pl.
    ;; Received 110 bytes from 150.254.78.79#53(ns1.asl24.pl) in 0 ms
    
    test:~#
    
    test:~# dig +nssearch asl24.pl
    SOA asl24.pl. root.asl24.pl. 3 604800 86400 2419200 604800 from server ns2.asl24.pl in 1 ms.
    SOA asl24.pl. root.asl24.pl. 3 604800 86400 2419200 604800 from server ns1.asl24.pl in 0 ms.
    test:~#
    
    test:~# dig www.asl24.pl +short
    150.254.78.79
    test:~#
    
    Wyszukanie wpisów na konkretnym serwerze DNS (atos.wmid.amu.edu.pl):
    test:~# dig @atos.wmid.amu.edu.pl www.asl24.pl +short
    150.254.78.79
    

    /etc/services

    bash-3.2$ cat /etc/services |head -30
    # See also: services(5), http://www.sethwklein.net/projects/iana-etc/
    #
    # PORT NUMBERS
    #
    # (last updated 2006-11-13)
    #
    # The port numbers are divided into three ranges: the Well Known Ports,
    # the Registered Ports, and the Dynamic and/or Private Ports.
    #
    # The Well Known Ports are those from 0 through 1023.
    #
    # DCCP Well Known ports SHOULD NOT be used without IANA registration.
    # The registration procedure is defined in [RFC4340], Section 19.9.
    #
    # The Registered Ports are those from 1024 through 49151
    #
    # DCCP Registered ports SHOULD NOT be used without IANA registration.
    # The registration procedure is defined in [RFC4340], Section 19.9.
    #
    # The Dynamic and/or Private Ports are those from 49152 through 65535
    #
    #
    #
    # ************************************************************************
    # * PLEASE NOTE THE FOLLOWING:                                           *
    # *                                                                      *
    # * 1. UNASSIGNED PORT NUMBERS SHOULD NOT BE USED.  THE IANA WILL ASSIGN *
    # * THE NUMBER FOR THE PORT AFTER YOUR APPLICATION HAS BEEN APPROVED.    *
    # *                                                                      *
    # * 2. ASSIGNMENT OF A PORT NUMBER DOES NOT IN ANY WAY IMPLY AN          *
    # * ENDORSEMENT OF AN APPLICATION OR PRODUCT, AND THE FACT THAT NETWORK  *
    # * TRAFFIC IS FLOWING TO OR FROM A REGISTERED PORT DOES NOT MEAN THAT   *
    # * IT IS "GOOD" TRAFFIC. FIREWALL AND SYSTEM ADMINISTRATORS SHOULD      *
    # * CHOOSE HOW TO CONFIGURE THEIR SYSTEMS BASED ON THEIR KNOWLEDGE OF    *
    # * THE TRAFFIC IN QUESTION, NOT WHETHER THERE IS A PORT NUMBER          *
    # * REGISTERED OR NOT.                                                   *
    # ************************************************************************
    #
    #
    # WELL KNOWN PORT NUMBERS
    #
    # The Well Known Ports are assigned by the IANA and on most systems can
    # only be used by system (or root) processes or by programs executed by
    # privileged users.
    #
    # Ports are used in the TCP [RFC793] to name the ends of logical
    # connections which carry long term conversations.  For the purpose of
    # providing services to unknown callers, a service contact port is
    # defined.  This list specifies the port used by the server process as
    # its contact port.  The contact port is sometimes called the
    # "well-known port".
    #
    # To the extent possible, these same port assignments are used with the
    # UDP [RFC768].
    #
    # The range for assigned ports managed by the IANA is 0-1023.
    #
    # Port Assignments:
    #
    # Keyword         Decimal    Description                     References
    #
    # Keyword         Decimal    Description                     References
    # -------         -------    -----------                     ----------
    #                 0/tcp    Reserved
    #                 0/udp    Reserved
    #                          Jon Postel 
    tcpmux            1/tcp    # TCP Port Service Multiplexer
    tcpmux            1/udp    # TCP Port Service Multiplexer
    #                          Mark Lottor 
    compressnet       2/tcp    # Management Utility
    compressnet       2/udp    # Management Utility
    compressnet       3/tcp    # Compression Process
    compressnet       3/udp    # Compression Process
    #                          Bernie Volz 
    #                 4/tcp    Unassigned
    #                 4/udp    Unassigned
    rje               5/tcp    # Remote Job Entry
    rje               5/udp    # Remote Job Entry
    #                          Jon Postel 
    #                 6/tcp    Unassigned
    #                 6/udp    Unassigned
    echo              7/tcp    # Echo
    echo              7/udp    # Echo
    #                          Jon Postel 
    #                 8/tcp    Unassigned
    #                 8/udp    Unassigned
    discard           9/tcp sink null    # Discard
    discard           9/udp sink null    # Discard
    #                          Jon Postel 
    discard           9/dccp sink null   # Discard SC:DISC
    #                          IETF dccp WG, Eddie Kohler , [RFC4340]
    #                10/tcp    Unassigned
    
    (.....)
    
    ftp-data         20/tcp    # File Transfer [Default Data]
    ftp-data         20/udp    # File Transfer [Default Data]
    ftp              21/tcp    # File Transfer [Control]
    ftp              21/udp    # File Transfer [Control]
    #                          Jon Postel 
    ssh              22/tcp    # SSH Remote Login Protocol
    ssh              22/udp    # SSH Remote Login Protocol
    
    (.....)
    
    #                          Christopher Leong 
    finger           79/tcp    # Finger
    finger           79/udp    # Finger
    #                          #                          David Zimmerman 
    http             80/tcp www www-http    # World Wide Web HTTP
    http             80/udp www www-http    # World Wide Web HTTP
    
    (.....)
    
    

    /etc/hosts

    kalkos@test:~$ cat /etc/hosts
    127.0.0.1       localhost
    150.254.78.2    atos.wmid.amu.edu.pl atos atos.amu.edu.pl
    
    
    # The following lines are desirable for IPv6 capable hosts
    ::1     localhost ip6-localhost ip6-loopback
    fe00::0 ip6-localnet
    ff00::0 ip6-mcastprefix
    ff02::1 ip6-allnodes
    ff02::2 ip6-allrouters
    ff02::3 ip6-allhosts
    kalkos@test:~$
    

    /etc/resolv.conf

    test:~# cat /etc/resolv.conf
    search vm.wmi.amu.edu.pl
    nameserver 150.254.78.2
    test:~#
    
    

    /etc/host.conf

    test:~# cat /etc/host.conf
    multi on
    test:~#
    
    Inne opcje pliku /etc/host.conf:
    order bind, hosts, nis
    multi 
    nospoof
    spoofalert
    spoof
    reorder
    

    /etc/resolv.conf

    test:~# cat /etc/resolv.conf
    search vm.wmi.amu.edu.pl
    nameserver 150.254.78.2
    test:~#
    
    Dodatkowe opcje resolv.conf:
    domain
    search
    sortlist
    
    

    /etc/nsswitch.conf

    test:~# cat /etc/nsswitch.conf
    /etc/nsswitch.conf
    #
    # Example configuration of GNU Name Service Switch functionality.
    # If you have the `glibc-doc-reference' and `info' packages installed, try:
    # \`info libc "Name Service Switch"' for information about this file.
    
    passwd:         compat
    group:          compat
    shadow:         compat
    
    hosts:          files dns
    networks:       files
    
    protocols:      db files
    services:       db files
    ethers:         db files
    rpc:            db files
    
    netgroup:       nis
    test:~#