Skip to content

Correct Hostname Configuration

I've always been a little grey on how to correctly / officially set the hostname in Arch Linux.

Arch Wiki - Set the Hostname

So in looking so, they recommend I append my fqdn to the end of the line that doesn't have any more columns. Seems arbitrary to me. Shouldn't it be a 2nd /other line in the /etc/hosts file?

127.0.0.1    localhost.localdomain    localhost
127.0.0.2    arch101.rdt              arch101
2 points2 comments
Open on Reddit
About this post
Posted
Archived
Score
2 · 100% up
Kind
Text
ID
2ctr6q

Author

13
posts
11
comments
1
media
View profile

2 comments

127.0.0.1 localhost yourhostname domain.com

..will work.

1 points

to the end of the line that doesn't have any more columns

The hosts file only really has two columns - the IP, and one or more hostnames to associate with that IP - see [wikipedia](http://en.wikipedia.org/wiki/Hosts_(file)#File_content). So you're not adding it on in an "extra" column, you're just expanding the second column, which is permitted.

1 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.