/etc/hostname and /etc/hosts

Hiya

I'm looking to set up a web and mail server on my Linode, and I was wondering if someone might be able to help set up the hosts file.

I've created subdomains like the following in DNS, all the entries point to the same Linode IP.

example.com

  • www.example.com

  • mail.example.com

I'm a little confused about the /etc/hostname file. Will the hostname specified here have any effect other than the console prompt, etc?

Also, could anyone help with writing a correct /etc/hosts file for the above? I'm not entirely sure how it's used and what the implications are.

Many thanks for any assistance!

1 Reply

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