Changing VM login from IP to TLD

When I login, the hostname is listed as ubuntu and not a domain name so I think this is causing me problems. My other host went under and I didn’t have a FQDN so I didn’t know what to put.I probably should fix it but I’m not sure how without completely messing everything up like email, etc.