Hostname usage without FQDN

I've got 2 linodes, currently the application server connects to the database server using an IP '192.168.xxx.xxx' as the specified host, a MySQL user is also specifed with an IP for the host 'userapplication@192.168.xxx.xxx'. What I'd like to do is set this up so I can connect to my database with 'mysql.serverhostname' and have mysql users as 'userapplication@serverhostname'.

Do I need to register a FQDN first then set this up in Linode's DNS manager? I'll be registering a domain soon so if it's a great deal of work I won't bother getting this to work without the FQDN. I'm new to networking so any guidance/tips would be much appreciated :)

I've created a hostname in /etc/hostname for each server.

And my /etc/hosts has:

127.0.0.1       localhost.localdomain   localhost
127.0.1.1       serverhostname
192.168.xxx.xxx mysql

0 Replies

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct