To change the Hostname:
Get the system hostname.
netmgr hostname --get
Set the system hostname.
netmgr hostname --set --name <hostname>
To change DNS Servers details:
Get the list of DNS servers.
netmgr dns_servers --get
Set the DNS mode (DHCP or static) for one or more DNS servers (comma-separated list).
netmgr dns_servers --set --mode <dhcp|static> --servers <server1,server2,...>
Add a DNS server to the list of DNS servers.
netmgr dns_servers --add --servers <server>
Remove a specified DNS server from the list of DNS servers.
netmgr dns_servers --del --servers <server>
Note: When changing the list of DNS servers (for example when changing networks or decommissioning old DNS servers), it is suggested to remove the current DNS servers first, then add the new ones. This is because there is a limited number of DNS servers that can be registered to the SRM server or vSphere Replication appliance.
To change the ipv4 Address:
Get the IPv4 address for the specified interface
netmgr ip4_address --get --interface <ifname>
Set the IPv4 address
netmgr ip4_address --set --interface <ifname> --mode <dhcp|static|none> --addr <ipv4_address/prefix> --gateway <gateway_address>
Below commands to be used to restart service.
systemctl restart systemd-networkd (For network)
systemctl restart systemd-resolved (For DNS)