Edit the zone file for your domain (e.g., /var/named/emc.world.lan):
[root@dlp ~]# vi /var/named/emc.world.lan
Add the CNAME record in the zone file:
$TTL 86400
@ IN SOA dlp.emc.world. root.emc.world. (
# update serial if updating the zone file
2022011102 ;Serial
3600 ;Refresh
1800 ;Retry
604800 ;Expire
86400 ;Minimum TTL
)
IN NS dlp.emc.world.
IN A 10.0.0.30
IN MX 10 dlp.emc.world.
dlp IN A 10.0.0.30
www IN A 10.0.0.31
# [Alias] IN CNAME [Original Name]
ftp IN CNAME dlp.emc.world.
Save the file, and then reload the BIND configuration:
[root@dlp ~]# rndc reload
server reload successful
To verify the CNAME resolution, use the dig command:
[root@dlp ~]# dig ftp.emc.world.
Sample Output:
; <<>> DiG 9.16.23-RH <<>> ftp.emc.world.
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 10460
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
; COOKIE: 37484bef3347a76d0100000061dccfb694487772279a5aca (good)
;; QUESTION SECTION:
;ftp.emc.world. IN A
;; ANSWER SECTION:
ftp.emc.world. 86400 IN CNAME dlp.emc.world.
dlp.emc.world. 86400 IN A 10.0.0.30
;; Query time: 2 msec
;; SERVER: 10.0.0.30#53(10.0.0.30)
;; WHEN: Tue Jan 11 09:30:46 JST 2022
;; MSG SIZE rcvd: 104
If the CNAME record is correctly configured, you will receive an answer section indicating that ftp.emc.world is a CNAME for dlp.emc.world.