A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.zytrax.com/books/dns/ch8/a.html below:

Chapter 8 - IPv4 Address (A) Record

IPv4 Address Record (A)

Defined in RFC 1035. Forward maps a host name to IPv4 address. The only parameter is an ipv4 field which is a single IPv4 address in dotted decimal format. The ipv4 field is an address not a label (name) and therefore is not terminated with a '.' (dot). Valid owner-name format (a.k.a 'label' in the DNS jargon). If host name is BLANK (or space) then the last valid name (or label) is substituted.

Format
owner-name  ttl  class   rr     ipv4
joe              IN      A      192.168.254.3

If multiple addresses are defined with the same name then BIND will respond to queries with all all the addresses defined but the order may change. Cyclic order is the BIND default but you can control it with the BIND named.conf statement rrset-order. The same IP may be defined with different names (Beware: in this case a reverse lookup may not give the result you want). IP addresses do not have to be in the same class or range. IPv4 addresses are reverse-mapped using the PTR RR.

Note: A RRs translate a name to an IPv4 address - the owner-name does not have to be the real host name of the PC or server (as it appears in /etc/hosts or in response to a hostname command). It can be, or not, as you choose. Thus, if a servers's name is alice.example.com with an IP address of 192.168.2.1 and it provides, say, a DNS service then you can either define an NS RR for alice.example.com or define an NS RR for, say, ns1.example.com and an A RR for ns1.example.com A 192.168.2.1 (the same IP address as host alice.example.com) as illustrated below:

; zone file snippet
$ORIGIN example.com.
...
       IN  NS  alice.example.com.
...
alice  IN  A   192.168.2.1 ; real host name

; equally valid configuration

       IN   NS  ns1.example.com.
...
ns1    IN   A  192.168.2.1 ; service name
alice  IN   A  192.168.2.1 ; host name (same IPv4)
Examples & Variations
; zone fragment for example.com
$TTL 2d ; zone default = 2 days or 172800 seconds
joe        IN      A      192.168.0.3  ; joe & www = same ip     
www        IN      A      192.168.0.3
; functionally the same as the record above
www.example.com.   A      192.168.0.3
fred  3600 IN      A      192.168.0.4  ; ttl overrides $TTL default
ftp        IN      A      192.168.0.24 ; round robin with next
           IN      A      192.168.0.7
mail       IN      A      192.168.0.15  ; mail = round robin
mail       IN      A      192.168.0.32
mail       IN      A      192.168.0.3
squat      IN      A      10.0.14.13  ; address in another range & class

In the above example BIND will respond to queries for mail.example.com as follows (assuming you are using the default rrset-order order cyclic):

1st query 192.168.0.15, 192.168.0.32, 192.168.0.3
2nd query 192.168.0.3, 192.168.0.15, 192.168.0.32
3rd query 192.168.0.32, 192.168.0.3, 192.168.0.15
4th query 192.168.0.15, 192.168.0.32, 192.168.0.3


Problems, comments, suggestions, corrections (including broken links) or something to add? Please take the time from a busy life to 'mail us' (at top of screen), the webmaster (below) or info-support at zytrax. You will have a warm inner glow for the rest of the day.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4