Questions tagged [hostname]

A hostname is the label given to a device connected to a computer network.

370 questions
54
votes
5 answers

How to correctly set hostname and domain name?

I am renting a server, running Ubuntu 16.04 at a company, let's name it company.org. Currently, my server is configured like this: hostname: server737263 domain name: company.org Here's my FQDN: user@server737263:~ $ hostname…
titsou
  • 543
  • 1
  • 4
  • 4
54
votes
7 answers

How to change hostname on CentOS 6.5?

I can't seem to change the hostname on my CentOS 6.5 host. I am following instructions I found on this (now defunct) page. I set my /etc/hosts like so ... [root@mig-dev-006 ~]# cat /etc/hosts 127.0.0.1 localhost localhost.localdomain …
Red Cricket
  • 2,183
  • 6
  • 25
  • 37
46
votes
5 answers

How to get the computer name (not its hostname)?

All the results of my searches end up having something to do with hostname or uname -n. I looked up the manual for both, looking for sneaky options, but no luck. I am trying to find an equivalent of OSX's scutil --get ComputerName on Linux systems.…
Jonathan H
  • 2,303
  • 3
  • 20
  • 27
40
votes
4 answers

Creating alias to domain name with /etc/hosts

I have a domain setup to point to my LAN's external IP using dynamic DNS, because my external IP address changes frequently. However, I want to create an alias to this host, so I can access it with home. So I appended the following to my…
Oliver Joseph Ash
  • 503
  • 1
  • 4
  • 6
36
votes
2 answers

How is it that missing 0s are automatically added in IP addresses? (`ping 10.5` equivalent to `ping 10.0.0.5`)

I accidentally typed ssh 10.0.05 instead of ssh 10.0.0.5 and was very surprised that it worked. I also tried 10.005 and 10.5 and those also expanded automatically to 10.0.0.5. I also tried 192.168.1 and that expanded to 192.168.0.1. All of this…
Nicu Stiurca
  • 555
  • 1
  • 6
  • 9
35
votes
2 answers

How to permanently change hostname in Fedora 21

I've heard that changing the hostname in new versions of fedora is done with the hostnamectl command. In addition, I recently (and successfully) changed my hostname on Arch Linux with this method. However, when running: [root@localhost ~]#…
PythonNut
  • 1,394
  • 2
  • 12
  • 19
31
votes
2 answers

What's the point of the hostnamectl command?

As opposed to editing /etc/hostname, or wherever is relevant? There must be a good reason (I hope) - in general I much prefer the "old" way, where everything was a text file. I'm not trying to be contentious - I'd really like to know, and to decide…
Graham Nicholls
  • 702
  • 1
  • 9
  • 20
29
votes
4 answers

How to set the fully qualified hostname on CentOS 7.0?

How do I set the fully qualified hostname on CentOS 7.0? I have seen a few posts online for example using: $ sudo hostnamectl set-hostname nodename.domainname However, running domainname returns nothing: $ domainname (none) Also: $…
Chris Snow
  • 4,046
  • 4
  • 23
  • 30
29
votes
4 answers

How to show the host name in Linux commandline prompt

I have several VMs and right now my command-line prompt looks like -bash-3.2$; identical on every VM, because it doesn't contain the host name. I need to always see which VM I'm on using hostname before I do any operation. How can I add the host…
uday
  • 391
  • 1
  • 3
  • 8
29
votes
3 answers

How to decrypt hostnames of a crypted .ssh/known_hosts with a list of the hostnames?

I try to find a script to decrypt (unhash) the ssh hostnames in the known_hosts file by passing a list of the hostnamses. So, to do exactly the reverse of: ssh-keygen -H -f known_hosts Or also, to do the same as this if the ssh config…
Xorax
  • 515
  • 1
  • 5
  • 9
26
votes
4 answers

Understand hostname and /etc/hosts

In /etc/hostname, I have myname. In /etc/hosts, I have : 127.0.0.1 localhost.localdomain localhost myname ::1 localhost.localdomain localhost myname I have a vague understanding of what really is a hostname and what it is used for. These…
Gradient
  • 3,579
  • 10
  • 31
  • 37
25
votes
4 answers

I changed my hostname, why is my bash PS1 prompt unchanged?

I changed my hostname by editing /etc/hostname and can see the new hostname using the hostname and hostname -F commands. But the shell prompt is still showing the old hostname. This is Ubuntu 11.0.4 by the way. The prompt is set in my .bashrc which…
Dizzley
  • 621
  • 1
  • 6
  • 8
22
votes
8 answers

How to get the hostname along with the domain name?

In Unix (Solaris) is there any command that returns the hostname and domain name together? For instance: hostname -> servername domainname -> us.xyz.com I need : servername.us.xyz.com
Vikas
20
votes
3 answers

How do I get to use .local hostnames with Arch Linux?

If I'm using Ubuntu or Linux Mint (the only two flavours I've tried and know work for sure), I can run something like this: wayne@myhost$ ssh [email protected] And the name is automagically resolved to whatever the IP of otherhost is on my…
Wayne Werner
  • 11,463
  • 8
  • 29
  • 43
20
votes
1 answer

How to filter by host name in Wireshark?

Display filter in form ip.src_host eq my.host.name.com yields no matching packets, but there is traffic to and from this host. DNS name is resolved successfully, and filters using ip addresses like ip.src eq 123.210.123.210 work as expected.
Petr Gladkikh
  • 471
  • 1
  • 3
  • 10
1
2 3
24 25