Change main domain via command line

OK, for various reasons (including coronavirus) I have moved our backup server to my home and I don’t have a static IP. I’m probably going down a bit of a rabbit hole here but I came across the Virtualmin command-line interface for changing domain details. Seems promising.

So I tried

virtualmin modify-domain --domain main_domain.com --newdomain nredomain.dydns.com

but is said

‘Virtual server imain_domain.com does not exist.’

Which is odd because that’s definitely the main domain, its the one it says I should be using when I do to the servers IP in a browser.

So then i did ‘virtualmin list-domains’ and the main domain is not there ;(. So I guess modify-domain does not apply to the main domain.

So is there a way of changing the main domain using the virtualmin CLI?

I know this is only part of the puzzle but I can probably write a script that uses this command-line program to set the IP also.

Ben

The problem is underscore in your domain name. You will not find any domain type i.e TLD or ccTLD would support registering domains with underscores in it.

If you want to rename a domain, the correct API command is virtualmin rename-domain

Note that use of underscores is not well supported, and not allowed in TLDs.

Not for webmin web interface. I actualy solved it by makinh sure /ect hostname and hosts had the correct fully specified domain (and remooted alough you can just type ‘hostname domain.tld’ ). Simple as that.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.