Linux Crash Course - Setting the Hostname of your Linux Workstation or Server

Поделиться
HTML-код
  • Опубликовано: 2 окт 2024
  • The "Linux Crash Course" series (formerly known as the "Linux Essentials" series) tackles important concepts around Linux, one video at a time. In this video, I show you how to set the hostname of your Linux server or workstation, with a full walkthrough of the commands required to do so. We will also take a look at editing the /etc/hosts file as well. This video is part of the Linux Crash Course series.
    📖 Check out Jay's latest book, Mastering Ubuntu Server 4th Edition. Covers Ubuntu 22.04!
    ➡️ ubuntuserverbo...
    🙌 Support me on Patreon and get early access to new content!
    ➡️ learnlinux.lin...
    ☁️ Get $100 toward your own cloud server with Linode!
    ➡️ linode.com/lear...
    🛒 Affiliate store for Linux compatible hardware/accessories (commission earned):
    ➡️ learnlinux.lin...
    💻 Check out the Tiny Pilot KVM for your Homelab (commission earned):
    ➡️ learnlinux.lin...
    🐦 Follow me on Twitter!
    ➡️ learnlinux.lin...
    💬 Official LearnLinux.tv Community:
    ➡️ community.lear...
    💽 How to create a bootable flash drive for installing Linux
    ➡️ linux.video/fl...
    🐧 Which distro do I use?
    ➡️ learnlinux.lin...
    🔐 How to better secure OpenSSH:
    ➡️ linux.video/se...
    ☁️ How to create a cloud Linux server with Linode:
    ➡️ learnlinux.lin...
    👨 More about me:
    ➡️ www.jaylacroix...
    ➡️ www.learnlinux...
    #LearnLinuxTV #Linux #Networking

Комментарии • 47

  • @richardravich8337
    @richardravich8337 3 года назад +26

    Jay, how about a quick tutorial on how to assign a static ip address to a Linux server/desktop? Thanks for all you do for the Linux community. Happy Holidays to you and your family

  • @wekiwa7055
    @wekiwa7055 3 года назад

    WOW, again I needed a quick answer and you have the video.

  • @ma-jt2cz
    @ma-jt2cz 3 года назад +5

    Really nice, my kid was able to do by following your instruction. - Thank you

  • @trapOrdoom
    @trapOrdoom 2 года назад

    YOOOO!!! Are you the guy who does the A+, Net+ tutorial voice overs? Jeez if so, you’re a legend.

  • @michalroesler
    @michalroesler Год назад +2

    That's awesome video Jay. You are the coolest Linux teacher in the Universe. Respect from Poland.

  • @chicamepa
    @chicamepa Год назад

    Thanks!

  • @2d0list39
    @2d0list39 3 года назад +3

    2021 and im a new linux user, kinda went in it blind and this tutorial i stumbled upon when i thought all hope was lost on such a small topic helped a lot

  • @TheDograncho
    @TheDograncho 3 года назад +3

    Thanks for your well explained videos. Please make it about sed and awk :)

    • @snooz78
      @snooz78 3 года назад

      you like being punished don't you lol it would be a good vid though.

  • @AltianoGerung
    @AltianoGerung 3 года назад +2

    But why should we also edit /etc/hosts
    why is it a best practice?

  • @kayathepiratebaykid
    @kayathepiratebaykid 2 года назад +2

    Actually a pretty neat and thought out intro.

  • @matyi1656
    @matyi1656 7 месяцев назад

    okay, but why does it automatically changes to my IPS's name after every damn boot, it also breaks applications... I know it has to do with Network Manager, still I dont understand why a system breaking option is default.

  • @marcin2x4
    @marcin2x4 Год назад

    I got an error on my WSL2 Ubuntu:
    `System has not been booted with systemd as init system (PID 1). Can't operate.
    Failed to create bus connection: Host is down`

  • @speedlinepro
    @speedlinepro Год назад

    well i got error still , Siege test sw in ubuntu
    says : [error] socket: unable to connect sock.c:282: No route to host
    can anyone help ! ☺♥♥♥
    is this the same host route or what s meaning of this errorin admin panel . ggl results end up in unknow
    test
    sudo siege -c20 -t10s "any-domain"

  • @peraruor
    @peraruor 3 года назад +1

    Hi. Love this short videos. I question i've got is, how can you change the order. For example, [serverName@userName] instead of [userName@serverName]. Thanks.

  • @nandhakishore3139
    @nandhakishore3139 Год назад

    i would like to know this hostname changes will work with vsftpd server?
    i am able to connect FTP user with IP address . i am looking to change it to hostname based login

  • @krzysztofh4074
    @krzysztofh4074 6 месяцев назад

    Thank you so much i had problems with it. Once more thank you so much

  • @ZapRodil461
    @ZapRodil461 Год назад +1

    Very clear explanation ! thanks

  • @filippomenis4438
    @filippomenis4438 3 года назад +1

    Thanks for your videos! The are always clear and userful.
    One question. Why you execute the "exec bash" command after change the hostname?
    Is a "shortcut" to force the terminal to be re executed with the new changes (in this case the hostname)?

    • @xrafter
      @xrafter 3 года назад

      exec is built-in function in bash and what it does is replace the current shell with command put in the second argument

    • @willwright9879
      @willwright9879 Год назад

      Thanks, it taught me what I needed to know right a way!

  • @noferblatz
    @noferblatz 3 года назад

    Why go through all this? I didn't even know the hostnamectl command before. I just edit the /etc/hostname file.

  • @SteveDaley
    @SteveDaley 3 года назад

    I was on Win10 when I watched this and tried "hostnamectl" on Ubuntu 20.04 in WSL2, but it didn't work because WSL2 doesn't use systemd for its init I guess. So I'm guessing this doesn't work with other none systemd distros as well. So would the preferred method be a simple "sudo nano /etc/hostname"? Jay, great job on recent videos, this Linux Essentials is a great idea for a series of videos. Love the homelab stuff too. Recent videos have really fit with the channel name "LearnLinuxTV." You have definitely brought your channel up another level, and you were already doing great work in the past too. Thanks for the excellent content.

  • @wisnoskij
    @wisnoskij 3 года назад

    What is the point of a command "hostnamectr" that does not do a complete job? So is the entire 127.x.x.x address space potential different hosts on that computer?

  • @englishwith_mark
    @englishwith_mark 4 месяца назад

    Great tutorial thanks

  • @TradersTradingEdge
    @TradersTradingEdge 3 года назад

    OMG! Just solved a internal DNS problem :) TNX Jay.

  • @RockawayCCW
    @RockawayCCW 3 года назад

    It just occurred to me, there needs to be a DOG command that chases CAT.

  • @mnk4allcaps
    @mnk4allcaps 6 месяцев назад

    ty

  • @AmichaiRotman
    @AmichaiRotman 3 года назад

    how would you go about it in an unattended BASH script?

  • @confidencemakoni9359
    @confidencemakoni9359 2 года назад

    Wow... Thank you... Feeling great now that l can change hostname.

  • @RickRomig
    @RickRomig 3 года назад

    I use a Bash script that uses the sed command to change the hostname in both /etc/hostname and /etc/hosts. It checks the new hostname against a set of rules to ensure it's vailid and also checks to be sure the changes were successully applied in both files.

  • @gawayenfamily
    @gawayenfamily 3 года назад

    nice. quick question: just installed Ubuntu desktop, do I need antivirus for it?

    • @samuel6252
      @samuel6252 3 года назад +2

      U don’t need too...

  • @OliverCalder
    @OliverCalder 3 года назад

    Editing /etc/hostname along with /etc/resolv.conf has worked great for me in the past to set my domain name on Debian, Pop, and Arch machines, but i just started using Fedora, and for some reason `hostname --fqdn` only gives my hostname (not domain name), and `dnsdomainname` prints a blank line. Using `resolvectl` allowed me to set dns and domain manually, but I've never had to do that before. It's as if /etc/resolv.conf was ignored. Any idea why?

    • @xrafter
      @xrafter 3 года назад

      Fedora deals with this differently as far as i know

  • @AnzanHoshinRoshi
    @AnzanHoshinRoshi 3 года назад

    Thank you, Jay. Byte sized then?

  • @NoEgg4u
    @NoEgg4u 3 года назад

    @3:50
    "So if I open a new tab, for example"
    Which terminal emulator are you using that offers multiple tabs per window?
    Various distros that I am sampling, via VirtualBox, do not have that feature. They seem to be bundled with basic terminal apps that do little more than let you choose the font and window transparency.

    • @RickRomig
      @RickRomig 3 года назад

      I use Terminator which can be split into multiple terminal windows. The default terminal emulator in Linux Mint supports multilple tabs.

    • @pavlospilakoutas
      @pavlospilakoutas 3 года назад

      Try shift+ctrl+t

    • @NoEgg4u
      @NoEgg4u 3 года назад +1

      @@pavlospilakoutas That worked. Thank you.

  • @ronshabi8830
    @ronshabi8830 10 месяцев назад

    All of your video are super clear and helpful. Thank you!

  • @awsarchitect7892
    @awsarchitect7892 3 года назад

    Any LFCS course

  • @joenaz4311
    @joenaz4311 2 года назад +1

    Your channel is perfect. Clear, concise and well presented. Thanks.

  • @srsr6099
    @srsr6099 3 года назад

    Cool, thank you

  • @EmirKATIRCI
    @EmirKATIRCI 3 года назад

    First of all thank you very much for the videos. Can you make a video showing how to migrate from Apache2 to Nginx? Much appreciated.

  • @anthonyedwards8403
    @anthonyedwards8403 2 года назад

    Your instructions worked! and I have stand corrected. Outstanding presentation.