Howto: Create a DNS entry through udm

Howto: Create a DNS entry through udm

You want to create a DNS alias (CNAME) or a host record (A) through command line tool udm.

Solution

To create a CNAME called “foo” pointing to host named “target” use:


root@ucs:~# udm dns/alias create --set cname="target.$(ucr get domainname)." --set name=foo --superordinate "$(udm dns/forward_zone list |sed -ne 's/^DN: //p;T;q')"

To create an A record (host record) called “foo” using IP address 172.16.9.43 use:

root@ucs:~# udm dns/host_record create --set name="foo.$(ucr get domainname)" --set a="172.16.9.43" --superordinate "$(udm dns/forward_zone list |sed -ne 's/^DN: //p;T;q')"

To create a CNAME through web interface UCM see here.

Mastodon