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@soncq ~]# vi /var/named/local.lan
$TTL 86400
@ IN SOA soncq.local. root.local. (
# update serial if update zone file
2021022402 ;Serial
3600 ;Refresh
1800 ;Retry
604800 ;Expire
86400 ;Minimum TTL
)
IN NS soncq.local.
IN A 10.0.0.30
IN MX 10 soncq.local.
soncq IN A 10.0.0.30
www IN A 10.0.0.31
# [Alias] IN CNAME [Original Name]
ftp IN CNAME local.
[root@soncq ~]# rndc reload
server reload successful
# verify resolution
[root@soncq ~]# dig ftp.local.
; <<>> DiG 9.11.26-RedHat-9.11.26-3.el8 <<>> ftp.local.
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 921
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 1, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
; COOKIE: 95bb76ad3b5fba2e9d888d7e6035b959129ae8ee7a065547 (good)
;; QUESTION SECTION:
;ftp.local. IN A
;; ANSWER SECTION:
ftp.local. 86400 IN CNAME soncq.local.
soncq.local. 86400 IN A 10.0.0.30
;; AUTHORITY SECTION:
local. 86400 IN NS soncq.local.
;; Query time: 0 msec
;; SERVER: 10.0.0.30#53(10.0.0.30)
;; WHEN: Thu July 14 14:54:33 ICT 2022
;; MSG SIZE rcvd: 118