0

Can somebody explain what does this mean? Explanation to each line will be helpful. I have mentioned some of my queries in comments too.

  1. 127.0.0.1 localhost //According to @Dave, it's machine ip.
  2. 127.0.1.1 dell-Inspiron-342 // then what is this ip of?

    The following lines are desirable for IPv6 capable hosts

  3. ::1 ip6-localhost ip6-loopback
  4. fe00::0 ip6-localnet
  5. ff00::0 ip6-mcastprefix
  6. ff02::1 ip6-allnodes
  7. ff02::2 ip6-allrouters
  • For a very thorough explanation of a /etc/hosts: en.wikipedia.org/wiki/Hosts_%28file%29 – Rinzwind Nov 8 '13 at 11:13
  • 1
    Sorry pal. It's lamp. I have just tagged xamp so that I can get attention of more people. It will be helpful if you answer my question. – Habi Nov 8 '13 at 11:15
  • It's not that I hate xamp. It's just that I like lamp :). Thanks for proving details on hosts through wikipedia. But I was hoping to know details on each line of host not about host. Anyway, thanks :) – Habi Nov 8 '13 at 11:24
  • @Rinzwind I think you can help me. I have numbered above line. Can you explain what is work of 1-7? – Habi Nov 8 '13 at 15:27
  • is this enough information? – Rinzwind Nov 8 '13 at 16:09
2

127.0.0.1 is the IP address for local machine. That means the machine you are working on and it is the same for all of us (we all have this). This line should not be messed with.

127.0.1.1. Section 10.4 of the debian manual:

Some software (e.g., GNOME) expects the system hostname to be resolvable to an IP address with a canonical fully qualified domain name. This is really improper because system hostnames and domain names are two very different things; but there you have it. In order to support that software, it is necessary to ensure that the system hostname can be resolved. Most often this is done by putting a line in /etc/hosts containing some IP address and the system hostname. If your system has a permanent IP address then use that; otherwise use the address 127.0.1.1.

Is added due to this bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=719621

Both of these IPs are IPv4. Since the world is running out of IP addresses there is also IPv6. Where IPv4 uses 4 numbers from 0 to 255 (roughly; so 2**32 permutations) IPv6 addresses are 128 bits long (so 2*128 permutations) used in 8 groups of 4 hexadecimal digits.

These ...

::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

are all IPv6 versions. ::1 is the IPv6 version of 127.0.0.1 so also means local host.

These are multicast addresses:

Well-known IPv6 multicast addresses

Address     Description
ff02::1     All nodes on the local network segment
ff02::2     All routers on the local network segment
ff02::5     OSPFv3 All SPF routers
ff02::6     OSPFv3 All DR routers
ff02::8     IS-IS for IPv6 routers
ff02::9     RIP routers
ff02::a     EIGRP routers
ff02::d     PIM routers
ff02::16    MLDv2 reports (defined in RFC 3810)
ff02::1:2   All DHCP servers and relay agents on the local network segment (defined in RFC 3315)
ff02::1:3   All LLMNR hosts on the local network segment (defined in RFC 4795)
ff05::1:3   All DHCP servers on the local network site (defined in RFC 3315)
ff0x::c     Simple Service Discovery Protocol
ff0x::fb    Multicast DNS
ff0x::101   Network Time Protocol
ff0x::108   Network Information Service
ff0x::114   Used for experiments
0

The /etc/hosts file tells a browser which IP a domain, or hosts has, without asking DNS-Services.

Normally LAMPP and co. are used to setup up servers on your local machine. The ip 127.0.0.1 ist known as any machine itself - so, if you're setting up the site lampas.tld on your local machine, add the following line to your file /etc/hosts:

127.0.0.1 www.lampas.tld lampas.tld

  • And what does this mean? 127.0.1.1 dell-Inspiron-342 Isn't this ip of this machine itself? If not what is this IP pointing at? – Habi Nov 8 '13 at 11:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.