Birmingham mumbai



Download 15,21 Mb.
Pdf ko'rish
bet322/482
Sana13.01.2022
Hajmi15,21 Mb.
#355107
1   ...   318   319   320   321   322   323   324   325   ...   482
Bog'liq
Mastering Ubuntu Server Gain expertise in the art of deploying, configuring, managing, and troubleshooting Ubuntu Server by Jay LaCroix (z-lib.org)

[
 245 
]
So, how do you view your hostname? One way is to simply look at your shell 
prompt; you've probably already noticed that your hostname is included there. 
While you can customize your shell prompt in many different ways, the default 
shows your current hostname. However, depending on what you've named your 
server, it may or may not show the entire name. Basically, the default prompt 
(known as a 
PS1 prompt
, in case you were wondering) shows the hostname only 
until it reaches the first period. For example, if your hostname is 
dev.mycompany.
org
, your prompt will only show 
dev
. To view the entire hostname, simply enter the 
hostname
 command:
Figure 10.1: Output from the hostname command
Changing the hostname is fairly simple. To do this, we can use the 
hostnamectl
 
command as 
root
 or with 
sudo
. If, for example, I'd like to change my hostname from 
dev.mynetwork.org
 to 
dev2.mynetwork.org
, I would execute the following command:
sudo hostnamectl set-hostname dev2.mynetwork.org 
Simple enough, but what 
does that command actually do? Well, I'd love to give you 
a fancy outline, but all it really does is change the contents of a text file (specifically,
 
/etc/hostname
). To see this for yourself, feel free to use the 
cat
 command to view the 
contents of this file before and after making the change with 
hostnamectl
:
cat /etc/hostname 
You'll see that this file contains only your hostname.
Once you change your hostname, you may start seeing an error message similar to 
the following after executing some commands:
unable to resolve host dev.mynetwork.org 


Connecting to Networks

Download 15,21 Mb.

Do'stlaringiz bilan baham:
1   ...   318   319   320   321   322   323   324   325   ...   482




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish