Debian 12 bookworm
Sponsored Link

BIND : Set Alias (CNAME)2023/06/15

 
If you'd like to set Alias (Another Name) to a Host, set CNAME record in a zone file.
[1] Set [CNAME] record in a zone file.
root@dlp:~#
vi /etc/bind/srv.world.lan
$TTL 86400
@   IN  SOA     dlp.srv.world. root.srv.world. (
        # update serial number
        2023061502  ;Serial
        3600        ;Refresh
        1800        ;Retry
        604800      ;Expire
        86400       ;Minimum TTL
)
        IN  NS      dlp.srv.world.
        IN  A       10.0.0.30
        IN  MX 10   dlp.srv.world.

dlp     IN  A       10.0.0.30
www     IN  A       10.0.0.31

# [Alias] IN CNAME [Original Name]
ftp     IN  CNAME   dlp.srv.world.

root@dlp:~#
rndc reload

server reload successful
# verify resolution

root@dlp:~#
dig ftp.srv.world.


; <<>> DiG 9.18.12-1-Debian <<>> ftp.srv.world.
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 5455
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
; COOKIE: 39f956d9ceb54a1b01000000648a70f88d272ec28418b94f (good)
;; QUESTION SECTION:
;ftp.srv.world.                 IN      A

;; ANSWER SECTION:
ftp.srv.world.          86400   IN      CNAME   dlp.srv.world.
dlp.srv.world.          86400   IN      A       10.0.0.30

;; Query time: 0 msec
;; SERVER: 10.0.0.30#53(10.0.0.30) (UDP)
;; WHEN: Wed Jun 14 21:01:28 CDT 2023
;; MSG SIZE  rcvd: 104
Matched Content