Change the domain name in a script

I want to write a script, which changes my domain name.
Sadly I haven’t found a command, which with this is possible.
I’ve just seen a way by editing net.cfg.
Isn’t there a command like “domainname [DOMAINNAME]” ?

I found, how to change the hostname, the ip-adress, the subnetmask… but not the domainname …:frowning:

Thanx a lot in advance.

setconf CS_RESOLVE=nameserver_1.2.3.4

setconf _CS_DOMAIN

RoverFan is right ofcourse. There is also the -n option to startup to change the domain name.

Thank you a lot!