D
D
Drew2016-08-26 03:36:17
linux
Drew, 2016-08-26 03:36:17

How to unmask my hostname?

I decided to clean up and customize my
Ubuntu 16.04
computer. I ran into a problem:
Even after I edited the hosts and hostname, and made sure with
cat /etc/hosts that everything works, getting the answer
127.0.0.1 localhost
127.0.1.1 my wanted name
neither before nor after service hostname restart , the name did not change in the line and still
[email protected] name:~$
And when
restarting, service hostname startFailed to start hostname.service is displayed: Unit hostname.service is masked.
What to do? I searched the English-speaking and ru forums, everywhere they write everything should change
unmask also tried

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
ipc_ngs, 2016-08-26
@druNJ

apparently the hostname service is disabled, you need to cancel the ban:
sudo systemctl unmask hostname.service
sudo systemctl enable hostname.service
https://fedoramagazine.org/systemd-masking-units/

D
Dmitry, 2016-08-26
@zmitrok62

sudo service hostname restart
Or restart the computer

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question