Tag Info

Hot answers tagged

90

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: ...


77

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.


72

Do not use an invented TLD. If ICANN were to delegate it, you would be in big trouble. Same thing if you merge with another organization which happens to use the same dummy TLD. That's why globally unique domain names are preferred. The standard, RFC 2606 reserves names for examples, documentation, testing, but nothing for general use, and for good reasons: ...


53

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 ...


36

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 ...


35

Use a subdomain of your company's registered domain for internal machines whose names you do not want available on the Internet. (Then, of course, only host those names on your internal DNS servers.) Here are some examples for the fictitious Example Corporation. Internet-facing servers: www.example.com mail.example.com dns1.example.com Internal ...


35

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.


29

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.


28

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 ...


26

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 ...


26

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 ...


23

RFC 1123 relaxes a constraint of RFC 952 which specifies a legacy of the Hostname Server Protocol (described in RFC 953) replaced by DNS. So a fully numeric hostname would be valid per these RFCs. RFC 1123 itself discusses consequences when it comes to IP versus hostname parsing : If a dotted-decimal number can be entered without such ...


22

There's another advantage of using an internal subdomain: cleverly using search suffixes and only hostnames instead of FQDN, you can build configuration files that work both in development, QA and production. For example, you always use "database = dbserv1" in your configuration file. On the development server, you set the search suffix to ...


21

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


21

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 ...


18

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 ...


18

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


17

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 ...


15

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 ...


14

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.com FQDN: bob.contoso.com ...


14

Set FQDN I'm using Debian 7 and this is what worked for me; thanks to Fernando Ribeiro. sudo vim /etc/hostname server # here's where you put the server's host name activate hostname sudo hostname -F /etc/hostname add domain name and address to the server sudo vim /etc/hosts 192.168.1.2 server.domain server VERIFY > hostname ...


13

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 ...


13

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.


13

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

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 ...


12

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


12

Originally the hostname couldn't start with a digit or underscore (RFC 952) but the new specification RFC 1123, as you mentioned, allows it. Concerning the call to isValid(), in this case, the full domain name should be passed in parameter: InternetDomainName.isValid("8server.com");


11

You will certainly have no problem finding references online which will tell you to definitely do it one way or another. It seems to me however that having a short name as the hostname, and have the fully qualified name in /etc/hosts is certainly much more prevalent. It seems like the more sensible way, as then services which need a fully qualified name ...



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