trying to use FQDN but now my hostname is invalid

I’m trying to use FQDN, but since i don’t really know how to do it now every time i use command hostname -f it will always return “the specified hostname is invalid”
would you guys kindly tell me where did i go wrong ?
i use sudo hostnamectl set-hostname hostname to change my hostname
and changed my “etc/hosts” to

127.0.0.1 localhost
127.0.1.1 hostname.mydomain.com hostname
[MyVpsIP] hostname.mydomain.com hostname

my hostname used to be “ubuntu”
(btw i use cloudflare to point my domain to my vps)
please help me guys i’m new to this kind of stuff
(and no, my hostname not using underscore(_) in it )