Skip to main content

Questions tagged [hostname]

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

Filter by
Sorted by
Tagged with
3 votes
1 answer
2k views

Value of /proc/sys/kernel/hostname

I've set computer hostname in /etc/hostname a while ago (also there are record in /etc/hosts). Everything worked fine, but recently I've noticed that value of hostname (and /proc/sys/kernel/hostname) ...
5 votes
3 answers
14k views

Need to force hostname update without restart

I need to change the hostname of a system without rebooting it. I'm running CentOS 7 and have the correct hostname in the /etc/hostname file but I'm still showing the old hostname at prompt. I know ...
19 votes
5 answers
31k views

Where does `hostname` store the hostname that I've set?

This is quite puzzling. Does anyone know where the hostname command stores and reads hostname from? I thought it was /etc/hostname but there is no such file on this Linux system that I'm using. I ...
23 votes
9 answers
159k views

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
1 vote
1 answer
52 views

The hostname command outputs two IP addresses when one is expected

# hostname --help | grep ip -i, --ip-address addresses for the host name -I, --all-ip-addresses all addresses for the host According to the above, -i should output just one IP address, ...
0 votes
2 answers
1k views

Can't ping or DNS resolve the EndeavourOS machine

I just installed EndeavourOS. I set my hostname using the command sudo hostnamectl set-hostname shuttle. When I try to ping shuttle from my other machines it is not able to resolve the IP address. I ...
0 votes
1 answer
2k views

Browse by hostname from internet browser

I can browse my server site using ip:8080 which is inside my home network.But I am not able to browse using hostname:8080 I do not have dns server. I have edited /etc/hosts file to include ...
2 votes
1 answer
29k views

Sendmail stopped sending mails (unable to qualify my own domain name (Centos) -- using short name)

All mails suddenly stopped sending, here is the maillog: Jan 26 17:02:20 vm2745 sendmail[3544]: My unqualified host name (Centos) unknown; sleeping for retry Jan 26 17:03:20 vm2745 sendmail[3544]: ...
0 votes
2 answers
30 views

ProxyPass return 404, but one name OK

Good day to all. I'll give you an example, I tried it There are 2 entries for BalanceMember in /etc/hosts. Of course, don’t look at these virtual machines, it’s a black box. All requests return to 404 ...
2 votes
2 answers
3k views

BIND as a DNS server host command is refused

I am attempting to run my host machine as a DNS server, it will also function as the gateway. My /etc/named.conf is as follows: options { directory "/var/named/"; allow-query {127.0.0.1;...
1 vote
1 answer
1k views

Installing systemd-resolved kills dns lookup

Update After uninstalling and re-installing systemd-resolved, the issue seems to have righted itself. I do not understand why, but I did notice that the /etc/resolv.conf does not get modified after ...
56 votes
6 answers
390k views

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: ...
1 vote
1 answer
638 views

sudo command showing delay after using hostnamectl to set hostname

I've got a system - accessible over local network but not connected to the internet. I'm facing issues when changing the hostname of this system. I know that changing hostname is a two step process: ...
1 vote
0 answers
117 views

avahi-daemon runs with wrong hostname

I have a problem on one device where the avahi-daemon is running with the wrong hostname and it is messing up my system. The hostname is ABC-100001 but when I check the process list it shows that ...
3 votes
2 answers
904 views

What is the best way to keep a Linux server's hostname consistent?

We have a server with a CentOS distribution of Linux. It lost its hostname in the month somehow, since our last reboot. We ran an ETL (extract, transform, load) job last week, and part of that ...
1 vote
1 answer
380 views

systemd ignores /etc/hostname at startup

Our team works with a custom, barebone linux distro for an embedded device, and it uses systemd. The system used to rely on SystemV init scripts until stuff got migrated to systemd (including network ...
9 votes
5 answers
53k views

Mac OS X Terminal Equivalent for Host Name Info

In Linux, using a Bash Terminal, I can do: hostname -d to display the name of the DNS domain, and hostname -i to display the network address(es) of the hostname . How can I retrieve the same ...
0 votes
1 answer
101 views

Howto change linux hostname on mounted (copied) drive

I have copied my headless Ubuntu 22LTS server to a backup drive with dd, and I want to deploy it as a backup server with the same relevant settings. What is the proper way to change the hostname on ...
2 votes
1 answer
320 views

How I can increase size of hostname from 64 to more characters in centos?

I want to set my centos instance hostname which is more then 64 characters Example: cent07-env07-ins01-xyz23-pro-dot-1692697882-b.dev.api.mywebsite. => 64 characters which is allow But as per our ...
0 votes
1 answer
3k views

How to use hostname rather than IP address for website

I've set up a VirtualBox VM which has an apache webserver running. I've created a webpage and I can navigate to it via the IP address on devices in the lan. However I want to use a hostname rather ...
0 votes
1 answer
56 views

password to linux changed after deleting/manipulation with ssh

Unfortunatelly I made mistake somewhere but can't get where. I had issues with ssh and github, tried different things and they didn't work. Later I decided .. i think.. moved file i balieve it was ...
22 votes
3 answers
26k views

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 ...
5 votes
2 answers
14k views

How can I find out the hostnames of other computers in the same local network?

In my local wifi, I can find out the IP and MAC of another computer which also runs Lubuntu, and whose hostname is known to me. $ sudo arp-scan olive [sudo] password for t: Interface: ...
5 votes
2 answers
18k views

How to edit /etc/hosts without sudo?

I have a machine that I can only access using SSH. I was messing with the hostnames, and now it says: ssh: unable to resolve hostname I know how to fix it in /etc/hosts. Problem is, I need sudo ...
1 vote
1 answer
65 views

Mutt fails to send email

In my Azure ci/cd pipeline, I am executing tests on Ubuntu 20.04. At the end of the test, I created task in the azure pipeline , to send an email to team with attachment of test reports. I am using ...
1 vote
2 answers
251 views

Hostname problem in Host-based authentication when using SSH

Right now our team can connect to servers via SSH public key authentication. Each team member has a private key on his PC in ~/.ssh/ and the public key is on the server in the authorized_key file. A ...
2 votes
1 answer
6k views

Fail to ssh to remote machine via hostname

The problem is that I fail to SSH to a remote machine via its hostname, while using its IP works. The hostname returned by command hostname is: california_desert while the name returned by command ...
0 votes
1 answer
1k views

Cannot ssh into a host using hostname.local

When trying to ssh from terminal into my raspberry pi using: ssh [email protected] the connection just hangs forever. When I ping [email protected], I get ping: cannot resolve [email protected]: ...
0 votes
0 answers
49 views

Can't ping hostnames and IPv6 after router restart

This happened after a router restart. (no idea if this is relevant but my Windows PC also reverted the DNS settings to an old local server I tested) I noticed the issue when I ssh'ed to my homelab ...
12 votes
3 answers
4k views

What determines the Linux hostname?

In the few years I've been using Linux as my main system, specifically Fedora, I've always seen my hostname set to just "localhost", with the exception of when I connect to some networks and it ...
0 votes
1 answer
319 views

Broadcast multiple hostnames on LAN

I have a home server set up to which I have assigned multiple IPs. The network is 192.168.196.0/24, and all the IPs from 130 to 139 are assigned to the same device (the home server). In that server, I ...
0 votes
0 answers
121 views

How do I access device using hostname that is hosting an access point?

I have an embedded linux device hosting an access point, I set it up like this: sudo apt install dnsmasq-base -y nmcli connection add type wifi ifname wlan0 con-name access_point autoconnect yes ssid ...
-1 votes
1 answer
348 views

ssh caches host names?

I changed a host address in /etc/hosts and it is definitely working because if I do ping [hostname] then the correct address is pinged. However, when I run ssh [hostname] I get the OLD host address. ...
0 votes
1 answer
652 views

Cannot resolve local sub domain on network

I have a raspberry with a dnsmasq server installed (via NetworkManager). I need to be able to resolve *.raspberry.local on my local (private) network. Here is my config : In /etc/NetworkManager/...
0 votes
1 answer
11k views

DRBD - 'node1' not defined in your config (for this host) - Error when setting Primary

I am getting the following error when trying to set the Primary node for DRBD. 'node1' not defined in your config (for this host). I know this is related to DNS/Hostname/Hosts and the config ...
1 vote
2 answers
4k views

$(hostname) doesn't work in cronjob [duplicate]

I have a simple backup script with this line to come up with a name for the backup: backup=$(/bin/date +'%Y-%m-%d_%H:%M_%S')_$(hostname).gz It works great when I run it under the root user. ...
1 vote
1 answer
27k views

Set a host name alias in /etc/hosts?

I'm having an issue relating to host names and SSL signing. The certificate signing process works fine if my host name is puppet. With the IP of the puppet master server being set in /etc/hosts. I ...
1 vote
0 answers
906 views

sudo: unable to resolve host debian: Name or service not known. I've already set host name in /etc/hostname and /etc/hosts but it keeps changing?

Hello Linux community. I have a VPS service bought from Vultr, so this is not some home standalone PC with Linux installed on it. I have to deal with all this obscure Control Panel setup they "...
0 votes
0 answers
60 views

Ubuntu: Broadcast CNAMES/Alias to the router/ DHCP server/ DNS server

I am trying to build a portable home server with a Intel NUC. My requirement is to plug my NUC to any of my friends or relatives router and with minimal configuration, preferably no configuration, be ...
0 votes
0 answers
504 views

Cannot SSH with hostname on a Raspberry Pi

I'm trying to configure my Raspberry Pi using Ansible and the first thing that I did was to change the hostname in the /etc/hosts file via Ansible and I was able to do that. After running my Ansible ...
0 votes
2 answers
112 views

Domain Name as IP Abstraction vs. Domain Name as Name of Server - /etc/host{s,name} - Why?

A domain name is an abstraction for an IP address. Regardless of which computer is at that IP, the domain name should point there. So why then do we associate a domain name with a computer using the ...
0 votes
1 answer
759 views

echo ${hostname}; vs echo $(hostname);

Could you please explain the difference between: echo ${hostname}; and echo $(hostname); echo ${hostname}; - shows nothing, just an empty line. echo $(hostname); - shows information from /etc/hostname....
2 votes
3 answers
7k views

Changing the hostname on a Linux Mint desktop to a random value at boot time

When changing the hostname to a random set of alphanumeric characters on a machine running Linux Mint(17.1 Rebecca, Cinnamon 64-bit) I encounter some problems. The following script changes the ...
1 vote
1 answer
1k views

Debian net install to preseed hostname and domain name

Basically the opposite of Debian preseed: How to force prompt for hostname and domain? With the new Debian bullseye release, the net install is asking me for hostname and domain name. How to preseed ...
-3 votes
1 answer
59 views

Command prompt write a command

its asks me to Store the output of the command “hostname” in a variable. Display “This script is running on _.” where “_” is the output of the “hostname” command. how can I do that
2 votes
2 answers
11k views

How to get NetBIOS name from IP

My friend has a PC that uses Windows, and I want to know the name of that computer. All I know now is that his IP address is 10.0.0.2, how can I get his computer's name from my Linux box?
1 vote
0 answers
936 views

Multiple hostnames for a single IP address in local network

I'd like to know if it is possible to have multiple hostnames for a single IP address in my local network, so that all hostnames point to the same IP-address (kind of an alias) Example: name ...
1 vote
1 answer
712 views

Using hostname output in linux with sed

I am trying to use part of the hostname output in Linux and use it in a file using sed. For example, I am using this command as hostname |tail -c 4 which shows me output as last 4 numbers and then use ...
0 votes
0 answers
108 views

WiFi router assigning different hostname despite sending gethostname()

For some reason my wifi router is assigning an altered hostname to my linux device. The hostname on my device is for example shserver2, my CLI login shows me@shserver2: and my /etc/hostname file ...
0 votes
0 answers
78 views

finger daemon / nc fowarding error

For an assignment I'm trying to properly send a buffer overflow exploit with ncat in order gain root access on a vulnerable machine set up by the professor. I feel I created my egg right but I keep ...

1
2 3 4 5
8