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

learn more… | top users | synonyms

29
votes
2answers
2k views

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 automagically to 10.0.0.5. I also tried ...
9
votes
2answers
21k views

How to change the hostname of a linux machine using terminal?

I logged in for the first time, opened terminal, and typed in ‘hostname’. It returned ‘localhost.localdomain.com’. Then I logged as the root user in terminal using the command, ‘su –‘, provided the ...
8
votes
3answers
732 views

How to change a hostname

During Debian installation, I set my hostname to the wrong value, and now I would like to correct that.
7
votes
2answers
803 views

What are the ramifications of setting the hostname?

I have several Amazon EC2 servers and I'm using Chef to manage the configuration. I'd like to set the hostname so that the default bash prompt is more helpful. Right now after launching a new server ...
7
votes
1answer
4k views

Wildcard in /etc/hosts file

It seems that wildcards are not supported in the /etc/hosts file. What is the best solution for me to resolve all *.local domains to localhost?
7
votes
3answers
2k views

“Unable to resolve hostname” - how to cleanly change hostname without rebooting

At work, I work on a small website using Ubuntu servers hosted on Amazon EC2 instances. We have two webservers, and at any given time one of them is 'live' and one is 'testing', but when we've got our ...
6
votes
3answers
5k views

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 ...
6
votes
1answer
290 views

Why the difference between network addresses reported by hostname and ping?

I have tried hostname and ping in a cluster machine, with different outputs. I am wondering what is the difference between the two? For example, on the same machine, hostname outputs node4.XXX and ...
6
votes
1answer
268 views

`hostname` - host name or FQDN?

What is the right thing to set a computer's hostname to? (/bin/hostname, /etc/hostname, sethostname(2), etc.) I usually just use the "name" part, and it works perfectly (for me at least), but I've ...
5
votes
5answers
606 views

resolve all ip addresses in command output using standard command line tools

I have several log files that contain a bunch of ip addresses. I would love to be able to pipe the data through a program that would match and resolve ip addresses. I.E. cat /var/log/somelogfile | ...
5
votes
3answers
6k views

How does traceroute resolve names?

While writing a script, I wanted to reference a machine by the computer name that I gave it (e.g. "selenium-rc"). I could not ping it using "selenium-rc", so I tried the following commands to see if ...
5
votes
1answer
381 views

Is there any way to access a hostname containing an underscore?

I have this weird problem. I need to access a website that contains an underscore from Linux. The hostname is invalid and Linux does treat it as such. The problem is that access from Windows seems to ...
4
votes
2answers
734 views

Why is my hostname different in Emacs?

So I changed the name of my computer recently, by editing /etc/hostname. The bash prompt is user@name, so I know it has worked. But in emacs, in the window bar it says emacs@name.tiscali.co.uk. ...
4
votes
1answer
107 views

Getting a website's ip with 'host'?

Why is it that when I run the command host examplewebsite.com it gives me website's ip, but for some websites, when I type that IP address into the address bar and hit enter, it shows me a 404 page? ...
4
votes
2answers
2k views

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 ...
4
votes
6answers
11k 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
4
votes
2answers
1k views

in which file is hostname alias persistent, if not /etc/hosts?

In order to have an alias for my server, which can be seen in a "hostname -a" command, I edited the /etc/hosts file to add the alias at the end of the entry containing the hostname. For example, my ...
4
votes
1answer
139 views

show hostname in top

I'm using top with tmux to monitor the most-CPU-consuming processes on different computers. How can I get the hostname to be displayed in each pane? Can I tell top to display the hostname somehow?
4
votes
2answers
92 views

Preseed.cfg ignoring host setting

I am installing Debian Wheezy (netinstall) in VirtualBox using preseed.cfg. I tried both d-i netcfg/get_hostname string somehost and d-i netcfg/get_hostname string somehost, but in both cases the ...
3
votes
2answers
10k views

Unable to resolve hostname

So I try to do: ssh $(hostname) and it tells me: ssh: Could not resolve hostname woofy: Name or service not known It knows that its own hostname is "woofy"; why can't it connect to itself?
3
votes
2answers
280 views

Obtaining remote host name in bash script

Sorry my knowledge of Linux bash commands is pretty basic, I've been searching for a while but I'm not 100% sure what I need to search for. I was wondering if there's a way to grab the current logged ...
3
votes
2answers
2k 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 wayne@otherhost.local And the name is automagically ...
3
votes
1answer
82 views

How to deny access to specific port when destination is NOT a specific host?

I'm trying to DENY access to port 1000 when it is being accessed through any host or IP that is NOT a specific host. I.e. If I try to access the service on sub.domain.com:1000 I should get in. If I ...
3
votes
2answers
4k views

What is sendmail referring to here?

When I install sendmail from the debian repos, I get the following output: Disabling HOST statistics file(/var/lib/sendmail/host_status). Creating /etc/mail/sendmail.cf... Creating ...
3
votes
1answer
133 views

Obtain the “pretty” hostname in bash

On my Fedora 19 system, I am able to change the system hostname with hostnamectl. This allows me to set several things, such as the static (normal) hostname, as well as a "pretty" hostname. Is there ...
3
votes
2answers
2k views

How to request a hostname from a DHCP server on Ubuntu?

I have an Ubuntu 11.04 server virtual machine. I would like to request a specific hostname from the DHCP server at the office. Since I don't run it often, the IP changes nearly every time that I boot ...
3
votes
1answer
142 views

Display hostname in GDM3 on Fedora 19 at login screen

I'm managing almost 100 lab PC's running Fedora 19. It's difficult to manage because it seems like no where that I can display the hostname at the login screen. GDM version: gdm-3.8-3.2
3
votes
1answer
1k views

Using DNSMasq for Local Hostname Resolution

I'm working on setting up a home intranet for me and my roommates. My idea is that we'll be able to store things like past utility bills in a place that's more accessible than a drawer in the kitchen ...
2
votes
1answer
401 views

Changing hostname without errors

I tried to change my hostname according to this guide for Debian based system: I edited /etc/hostname I ran /etc/init.d/hostname start Though there are errors. Always when I write a sudo command ...
2
votes
1answer
208 views

ZSH %m prompt escape not working as documented under Debian Linux

The zshmisc man page on my new Debian Squeeze install states, under SIMPLE PROMPT ESCAPES: %m The hostname up to the first `.'. An integer may follow the '%' to specify how many components of the ...
2
votes
1answer
230 views

Remove a directory level from a website URL

Can anyone tell me how to configure apache to not display a website folder name at the end of a base URL, please? - but only for one out of many websites. Let me describe the scenario ... I have a ...
2
votes
2answers
3k views

Get client hostnames from DHCP

I have a voyage 2.6.38 machine running DNSMASQ for a DHCP server and I would like to get the hostnames of the clients that acquire DHCP leases. How would I go about doing this?
2
votes
1answer
1k views

Hosts file on server with dynamic DNS?

I am setting up a RHEL-based server that is associated with dynamic DNS from DynDNS, with a domain of, say, "abc.dyndns.org" that is dynamically updated with the server's IP address. I have read that ...
2
votes
1answer
388 views

Short domain name to FQDN expansion

Is it possible to configure where the system will look for the machine if I enter just a short domain name? I work in a grid environment where the machines are many and spread across multiple ...
2
votes
1answer
36 views

Viewing hostnames in network

Is there Linux command equal to Net View in Windows, that shows hostnames in your network? I am in a VPN network and want to see computer names in my network.
2
votes
1answer
376 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 ...
2
votes
1answer
54 views

Why when I enter the command “hostname” it returns something other than my computers name?

I am using a macBook Pro I enter: new-host-2:~ Justin$ hostname And it returns: new-host-2.home Why is this when it says in setting/sharing my computers name is "Justin's macbook pro" and computers ...
2
votes
2answers
289 views

How is my domainname determined?

If I look into /etc/hostname/ I can see the hostname of my device. This is however not the name that shows up when I use nslookup on our network. How do I tell the DNS server which name it should use? ...
2
votes
1answer
268 views

How to add another domain to my chrooted named server

Firstly I successfully have a domain working in a chroot named. There are files in /var/named/chroot/var/named called mydomain.com.db and named.local and named.root. Also in /var/named/chroot/etc ...
2
votes
1answer
76 views

rsyslog using short hostname

I'm using CentOS 6.5 and rsyslogd: Name : rsyslog Arch : x86_64 Version : 5.8.10 Release : 8.el6 In rsyslog.d's conf file I have: $PreserveFQDN on and ...
2
votes
1answer
69 views

How to property configure DNS . . . from a conceptual perspective

I'm not looking for actual tools or techical how to type answers here. I'm in a complex networking environment, and I'm trying to understand the constraints on my choice of a hostname / domain / DNS ...
2
votes
3answers
72 views

Can DNS identify hostnames dynamically if they're statically configured?

I've got a small environment of ~40 VMs with static IPs on 12 servers, it would be dandy if I could refer to each VM by name. We have a lot of VMs come and go, so maintaining one static list is a ...
2
votes
2answers
2k views

Fedora 16 ssh over the internet/home network help. Same computer ok

I first posted this on serverfault, but this forum seem to be more appropriate. http://serverfault.com/questions/345471/fedora-16-ssh-over-the-internet-home-network-help-same-computer-ok I think I ...
2
votes
3answers
420 views

How to append / extend zshell completions?

I am using zsh with oh-my-zsh. Unfortunately, oh-my-zsh does not use file ~/.ssh/config for hostname auto-completion (see Issue #1009, for instance). This could easily archived by the following code: ...
2
votes
0answers
167 views

why is FQDN using external IP address

When postfix connects to the FQDN dur.bounceme.net it uses the external IP address: root@dur:~# root@dur:~# tail /var/log/mail.log Aug 28 04:39:45 dur postfix/master[6667]: terminating on signal 15 ...
1
vote
2answers
3k views

What is a valid hostname label?

I set up my hostname to a number, where running hostname gives: 6592 But when I run ping 6592, I get: connect: Invalid argument I checked the related Wikipedia page, and it does say that such a ...
1
vote
3answers
294 views

I changed my hostname, rebooted and lost internet connection

I set a new hostname on my machine using: sudo hostname NEWHOSTNAME Then I restarted, and tried accessing the internet and nothing happened. I checked the hostname and it was set to ...
1
vote
2answers
89 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
1answer
17 views

Which kind of additional cleanup may be required after removing manually added entries from /etc/hosts?

My system is "Unable to resolve" removed entry from /etc/hosts. During development, I needed to add the custom domain entry to /etc/hosts, stating it resolves to 127.0.0.1. This mapping worked fine. ...
1
vote
1answer
56 views

AIX cifs hostname with underscore

I am trying to type this comand but for some reason it takes the first and not the second version. I have entered both the host names in the host file, FYI. This command works (hostname zq13c1): ...