Wilson Mar bio photo

Wilson Mar

Hello!

Email me Calendar Skype call

LinkedIn Twitter Gitter Instagram Youtube

Github Stackoverflow Pinterest

Translate domain names to IP addresses

US (English)   Español (Spanish)   Français (French)   Deutsch (German)   Italiano   Português   Cyrillic Russian   中文 (简体) Chinese (Simplified)   日本語 Japanese   한국어 Korean

Overview

DNS servers obtain IP address from URL names by forwarding requests it cannot resolve from its own tables.

ICMP Ping

  1. To identify the IP address of a domain name:

    ping google.com

    Because this can be a vector for denial of service attacks, many organizations disable ping responses:

    A sample response returned:

    PING google.com (216.58.193.206): 56 data bytes
    Request timeout for icmp_seq 0
    Request timeout for icmp_seq 1
    

    A sample response returned:

    PING google.com (216.58.193.206): 56 data bytes
    Request timeout for icmp_seq 0
    Request timeout for icmp_seq 1
    

    Dig name from IP

  2. To identify the domain name associated with an ip address:

    dig -x 8.8.8.8 

    Under “ANSWER SECTION:” is “google”:

    ; <<>> DiG 9.10.6 <<>> -x 8.8.8.8
    ;; global options: +cmd
    ;; Got answer:
    ;; -<<HEADER<<- opcode: QUERY, status: NOERROR, id: 6599
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
     
    ;; OPT PSEUDOSECTION:
    ; EDNS: version: 0, flags:; udp: 4096
    ;; QUESTION SECTION:
    ;8.8.8.8.in-addr.arpa.		IN	PTR
     
    ;; ANSWER SECTION:
    8.8.8.8.in-addr.arpa.	300	IN	PTR	dns.google.
     
    ;; Query time: 64 msec
    ;; SERVER: 10.11.73.1#53(10.11.73.1)
    ;; WHEN: Thu Apr 09 13:16:59 MDT 2020
    ;; MSG SIZE  rcvd: 93
    

    For Microsoft.com, the response is “prd1.azuredns-cloud.net. msnhst.microsoft.com”:

    For apple.com, apple.com, ipad.host, appleid.org, pv-apple-com.apple.com, apple.by

Name Servers

Clients – called resolvers – make requests of DNS name servers.

Two DNS servers are usually specified (in client machine TCP/IP properties) for load balancing and fault tolerance.

DNS servers refer to 3 types of records to answer 3 types of queries:

  • A (host Address) records are used to answer forward lookup of an FQDN (host name) to a specific IP address.

    On Windows, the host name to IP address mappings for a zone are stored in the Domain.dns file in the %systemroot%\System32\Dns folder.

  • PTR (Pointer resource) records are used to answer a reverse lookup of an IP address to a host name (another DNS domain name location). IP address to host name mappings are in the z.y.w.x.in-addr.arpa file. Create file 1.0.0.127.in-addr.arpa zone file for reverse lookup.

  • SRV (Server location) records are used to locate domain controllers. SRV specifies the server to which a DNS name server forwards when it cannot resolve a query.

    Windows servers require DNS to locate domain controllers. On Windows, DNS is installed as a Windows component on a domain controller with a static (not dynamic) IP address.

Other types of resource records:

  • NS records notate which DNS servers are designated as authoritative for the zone.

  • SOA (Start Of Authority) records indicate the name of origin and other basic properties for each zone, including the name of the primary server for the source for information about the zone,

  • CNAME (Cononical name) records define aliases.

  • MX (Mail exchanger) records define the preference number.

Zones

There is a separate set of DNSNode records for each DNSZone handled by a DNS server.

DNS only resolves queries for zones to which it has authority.

Zones are part of a hierarchial structure of top-level domains over Second-level domains (represented by the organization’s name, such as Microsoft or Compaq), etc.

Standard Active Directory Integrated
DNSZone Container Objects
DNSNode Leaf Objects

DNS zone data can be stored in text files on Primary or Secondary domain controllers. This is under the single master model.

Alternately, you can change a Windows 2000 DNS service to use the Active Directory Integrated database. Replication of AD data to other servers makes this a multi-master model.

This is done using the DNS Console Manager GUI – in a zone’s Properties dialog box General tab, click the change button.

Alternately, use a script to issue sub-commands from command interface

nslookup.exe
Default Server:   rns2.earthlink.net
Address: 207.217.77.82

AD Integration is reversed in the Advanced tab by setting the “Load Data On Startup” field to “From Registry”.

Configuration

One no longer directly edit /etc/resolv.conf

On Ubuntu, within /etc/network/interfaces

dns-namservers 192.168.1.1. 8.8.8.8
dns-search example.com
   

Reload network using /etc/init.d/networking reload

On Red Hat, write to interface:

/etc/sysconfig/network-scripts/ifcfg-eth0

DNS1=8.8.8.8 DNS2=192.168.1.1

To activate:

service network restart

system ctl restart NetworkManager

PROTIP: “NXDOMAIN” means that the domain name was not found.

Windows DNS

tool Use the Windows Network Monitor to monitor and capture packets sent to and from DNS servers.

tool DNS server administration can be done by a script using this utility from the Windows Server product CD:

    DNSCMD.EXE

Servers send an A (resource) record to DNS when it first boots up. To force a member server to register itself to DNS:

    ipconfig /registerdns

Event Log

tool In the Event Log, the DNS log file shows DNS request activities. But it doesn’t show specific zone property changes or information about existing zone transfers.

Caching-only DNS servers work from data cached while resolving queries using server in Root Hints stored in the Cache.dns file rather than from DNS zone transfers.