Tag Info

Hot answers tagged

84

Once upon a time I had an opportunity to decide on a naming scheme. So I went round and asked my developers, who after all were the people who had to work with these names on a day-to-day basis, whether they preferred functional names (that is, names which represent, in some encoded form, the purpose of the machine) or mnemonic names (that is, names drawn ...


82

This largely comes down to whether your servers are pets or livestock. Pets get individual names. They're distinct from each other, and we care about those differences. When one gets sick, we usually try to nurse it back to health. Traditionally, servers have been pets. Livestock get numbers. They're mostly identical, and what differences there are, we ...


71

There isn't a great deal of difference between the two; 127/8 (eg: 127.0.0.0 => 127.255.255.255) are all bound to the loopback interface. The reason why is documented in the Debian manual here: http://www.debian.org/doc/manuals/debian-reference/ch05.en.html#_the_hostname_resolution Ultimately, it is a bug workaround; the original report is here: ...


68

If you want to determine the name of a Windows machine without DNS, you should try Nbtstat. But that will only work on Windows: For example, NBTSTAT -A 10.10.10.10 On Linux, you should try nmblookup that does nearly the same.


40

I would choose a consistent approach across the entire environment. Both solutions work fine and will remain compatible with most applications. There is a difference in manageability, though. I go with the short name as the HOSTNAME setting, and set the FQDN as the first column in /etc/hosts for the server's IP, followed by the short name. I have not ...


31

Assigning more than one IP address to one hostname is also possible: rr.example.com. A 192.0.2.12 rr.example.com. A 192.0.2.23 rr.example.com. A 192.0.2.34 rr.example.com. A 192.0.2.45 When you query a DNS server for rr.example.com you'll get back a list of IP addresses back. You can then choose to connect ...


31

The technically preferable method is to type nslookup <ip address> NSLOOKUP actually asks the DNS server for the IP address of the hostname. Ping will use the local DNS Resolver Cache, which may be incorrect until you flush.


27

First off, anyone picking a naming scheme should read RFC 1178 - "Choosing a Name for Your Computer". People have been talking about this issue for as long as computers have been given names, so read up on what others have said before re-inventing the wheel. My own thoughts - I tend to break up naming policies into themes and schemes. Using a ...


25

Yes, it is possible for multiple hostnames to use the same ip address, the best practise is to use a CNAME record to point to the A record bar.example.com. CNAME foo.example.com. foo.example.com. A 192.0.2.23 Take note of all the full stops. Having one hostname to represent multiple ip addresses is a little more complicated. If we are ...


21

This is easily achieved with getent: getent hosts 127.0.0.1 getent will do lookups for any type of data configured in nsswitch.conf.


19

One tool that would work is getent. So you could use getent hosts www.google.com, or getent hosts localhost. It will retrieve entries from the databases as specified in your Name Service Switch configuration /etc/nsswitch.conf.


19

Yes, it would be possible, but you will lose some important advantages if you choose to do so: If you point all services to the same DNS name, you can't put them onto separate servers any more without reconfiguring any client that refers to them. As an example: With different names, when the load on the server grows too much, you can simply offload the ...


17

You can setup this on your DNS server, CNAME records allow a machine to be known by more than one hostname. So add CNAME records to your DNS server like that : fakehost1 IN CNAME realhost fakehost2 IN CNAME realhost fakehost3 IN CNAME realhost


16

For those who don't have an account on the forums (or don't wish to login): if your main issue is not to ping but to ssh, you can create/edit your ~/.ssh/config adding lines like these: Host fakehost1 Hostname realhost Host fakehost2 Hostname realhost Host fakehost3 Hostname realhost


16

This has been covered here before... My recommendation is a combination of functional names and mnemonic names... If you're writing an application and it needs to address ccts-logserver1, use that name throughout, but make that a CNAME or an alias. The real hostname can be whatever you want: a fruit or vegetable, greek mythology or Seinfeld character... ...


14

Here is an example: frontend http bind 0.0.0.0:80 default_backend www # NAT static host names and static paths in other hostnames to a different backend acl host_static hdr_beg(host) -i static. acl url_static path_beg /static use_backend static if host_static or url_static backend www balance ...


12

Your /etc/hosts file should have at least two records in it. The first record should be of the form: <IP_ADDRESS> <HOST_FQDN> <HOSTNAME> the second one should be of the form: 127.0.0.1 localhost You also need to make sure that your /etc/hostname file contains the server's FQDN, and that running hostname -f returns your servers FQDN. ...


12

These days, a system may have multiple interfaces, each with multiple addresses, and each address may even have multiple DNS entries associated with it. So what does a "system hostname" even mean? Many applications will use the system hostname as a default identifier when they communicate elsewhere. For example, if you're collecting syslog messages at a ...


12

You're asking for trouble with that naming scheme due to DNS, consider a-alpha instead.


12

To sum up the linked-to information: It is (debatably) useful to have an entry in your /etc/hosts translating the machine's fully-qualified domain name into its permanent IP address. debian-installer, and more specifically, its netcfg component, currently (up to March 2013 at least) creates this entry. If the machine is not known to have a permanent IP ...


11

Pretty much all software is sensitive to correctly setting the hostname. While I was working at Digg I once brought the entire site down for 2 hours due to making a seemingly innocent change in /etc/hosts that affected the system's notion of hostname. Tread lightly. That said, you may be slightly confused here. I don't think the HOSTNAME= setting is directly ...


11

No, just the hostname portion. According to Ubuntu's man pages, /etc/hostname should contain only the hostname portion of the hostname, not the FQDN: THE FQDN You can’t change the FQDN (as returned by hostname --fqdn) or the DNS domain name (as returned by dnsdomainname) with this command. The FQDN of the system is the name that the ...


11

No, computer names must be unique. When you added the second computer with the same name, windows changed the sid in the AD database that goes with that name making the first machine not able to talk to the domain. To keep the first machine on the domain, you'd need to remove the second machine from the domain, then readd the first machine back to the ...


11

Yes, there are currently two popular solutions to this problem. The first is called Anycast, where the same IP block is literally in use in multiple locations around the world. That is to say, the name servers for your domain always return the same IP address, but that IP address is actually assigned to more than one set of physical servers. You can read ...


10

Simply changed: 127.0.0.1 localhost localhost.localdomain 127.0.0.1 foo.bar To this 127.0.0.1 localhost localhost.localdomain foo.bar Sendmail looks for a fully qualified domain (FQDN) name and will use the localhost.localdomain in the single line version.


10

Your hostname is the name of your computer. Your fully qualified domain name is your hostname plus the domain your company uses often ending in .local. So if the name of your computer is bob, and your company's domain is contoso.local, your computer's fully qualified domain name is bob.contoso.local Hostname: bob Domain: contoso.local FQDN: ...


10

DNS Names are resolved when the rules are added, not, when packets are checked. This violates the expectations most people have. The rule does not get updated to reflect changed DNS results. It is resolved when added and that is it. You will need to either periodically reload rules, or some sites may break. There is a bit of a security issue in that ...


9

Certain applications will use the hostname for certain parameters unless explicitly set. Postfix, for example, will identify itself using the hostname of the machine unless you specify otherwise in the config file. The hosts file is used for name resolution. When resolving domain names, your server will check its hosts file before making a DNS request. ...


9

This depends on the distribution. From your post, it looks very much like you are using either RHEL or CentOS. That's what I'll assume in my answer. A lot of services look at the server's hostname, so it is very hard to generally give a complete overview of which services you need to restart. However, be aware of the following: Some Postfix installs ...



Only top voted, non community-wiki answers of a minimum length are eligible