Tag Info

Hot answers tagged

74

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


70

Install dnsmasq (I do this on all my Linux desktops as a DNS cache anyways). In dnsmasq.conf add the line: address=/localhost.com/127.0.0.1


41

Jon Postel picked 127. Before the Internet Assigned Numbers Authority took over (RFC 3232) around the time of his death (RFC 2468), he was the "czar" of Internet address and port assignments, having essentially nominated himself for the task. (RFC 349) Back in the early 1980s, when IPv4 as we know it was first being hashed out, existing networks were given ...


33

It is not possible to specify wildcards in the /etc/hosts file. Either specify the required hostnames explicitly or alternatively set up a local name server with the appropriate rules.


28

From the RFC: 127.0.0.0/8 - This block is assigned for use as the Internet host loopback address. A datagram sent by a higher level protocol to an address anywhere within this block should loop back inside the host. This is ordinarily implemented using only 127.0.0.1/32 for loopback, but no addresses within this block should ever ...


25

I have written a dns proxy in Python. It will read wildcard entries in /etc/hosts. See here: http://code.google.com/p/marlon-tools/source/browse/tools/dnsproxy/dnsproxy.py


24

For me, setting the ServerName property in httpd.conf fixed the delays (they were up to 10 seconds at worst): # ServerName gives the name and port that the server uses to identify itself. # This can often be determined automatically, but we recommend you specify # it explicitly to prevent problems during startup. # # If your host doesn't have a registered ...


18

There's a WIKI Entry about exactly this issue on the wireshark homepage. They also mention specifics about the loopback interface regarding Windows - you could be running just into that.


16

Inside the Service tag change: <Connector port="8080" protocol="HTTP/1.1" ... to: <Connector address="127.0.0.1" port="8080" protocol="HTTP/1.1" ... For more information: http://tomcat.apache.org/tomcat-6.0-doc/config/http.html


15

Use an IP-binding to 127.0.0.1 that should activate a listening port on "localhost". On the client side do not use "localhost" - use "127.0.0.1" instead. Many clients have an internal alias that makes them connect to the socket if you specify "localhost" as target. mySQL is strange.


15

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


14

The issue was with Apache's main settings file httpd.conf. I found this: There are three ways to set up PHP to work with Apache 2.x on Windows. You can run PHP as a handler, as a CGI, or under FastCGI. [Source] And so I went into the Apache's settings and saw where the problem was: I had it set up as CGI, instead of loading it as a module. This caused ...


14

MySQL will try to connect to the unix socket if you tell it to connect to "localhost". If you tell it to connect to 127.0.0.1 you are forcing it to connect to the network socket. So probably you have MySQL configured to only listen to the network socket and not to the file system socket. What exactly is wrong with your unix socket is hard to tell. But I ...


12

Yes, 127.0.0.1 is called loopback network and is always available. This address points to the machine itself. EDIT: To answer the second part of the question: Yes, machines A and B can be on the same network (but NOT the same as 127.0.0.1, while loopback is virtual) if the netmask is set properly. Use IP calculator to get what you need.


11

That's the default Apache HTTP index page. It's there to indicate you've correctly installed and enabled httpd.


10

You need to set up a DNS server and have each client use it for resolution. The server itself can be something as "light" as dnsmasq or as heavy as BIND.


9

I had the very same problem. Setting localhost redirect to 127.0.0.1 in hosts file did not help. Optimizing MySQL server did not help (InnoDB -> MyISAM, changing many cache related directives in my.ini). Then I used web webgrind and narrowed down the problem to "new PDO(...)" call. Changing mysql:host=localhost;dbname=dp-ui;charset=utf8 to ...


9

Change the ^HOSTNAME line in /etc/sysconfig/network Change the hostname (FQDN and alias) in /etc/hosts Run /bin/hostname new_hostname for the hostname change to take effect immediately. Run /sbin/service syslog restart for syslog to log using the new hostname. A reboot is not required to change the system hostname, of course you should reboot in order ...


8

I found the problem. The /etc/hosts file had overly restrictive permissions -rw------ (I believe that is 600 octal). Changing that to mode 644 fixed the problem. My tests with ping were done with ordinary priv, and the hosts file was unreadable. My original problem was getting postgresql to startup properly; it starts with root privilege, but apparently ...


8

The "do not change" warning refers to changing the name "localhost". Many software packages expect "localhost" to resolve to 127.0.0.1. Adding more entries is not a problem. You can add the entries after the host (as shown by Iain), or add additional lines. For example: 127.0.0.1 localhost 127.0.0.1 api.localhost 127.0.0.1 testsite2.localhost On ...


8

The simplest way is to make sure you have only localhost defined in mynetworks: mynetworks = 127.0.0.0/8, [::1]/128 By default smtpd_recipient_restrictions is set as: smtpd_recipient_restrictions = permit_mynetworks, reject_unauth_destination This will allow hosts defined in mynetworks (localhost, as above) to send anywhere, while everything else is ...


8

In Linux and other *nixes, MySQL will assume you want to use a socket if you connect to the host "localhost" (which would be the default hostname). You can override this in 3 ways: 1) Specify a different hostname like 127.0.0.1 (mysql -h 127.0.0.1) or your server's real hostname 2) Specify that you want to use TCP and not a socket (mysql --protocol tcp) ...


6

The page "It Works" is the default apache Vhost. If you are getting this, it has nothing to do with the hosts file. Will need more information on the url you are trying to access and what you expect to happen.


6

The hostname www.circle.nu is mapped to IP address 0.0.0.0 in their DNS. 0.0.0.0 is usually interpreted as the "default network", and in your case that's why you're getting sent to localhost.


6

What I did to disable local delivery. I'll be using the example.com domain. Requirements: example.com A entry pointing to IP address assigned to one of the eth interfaces. /etc/hosts defining example.com assigned to the very same IP address as above example.com MX records pointing to Google servers (ASPMX.L.GOOGLE.COM, etc) default sendmail installation ...


6

Yes it is possible and quite common, you want name based virtual hosts. There are basically two types virtual hosts, name based and ip based. It gets more complicated with name based if you intended to run SSL, but it is still possible. It works by looking at the HTTP header in the request to see the domain name being requested.


6

Isn't this really a client issue ? If using the mysql program You can use the --protocol switch. From the man page --protocol={TCP|SOCKET|PIPE|MEMORY} The connection protocol to use for connecting to the server. It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want. ...


5

C:\>nslookup www.rehash.com *** Can't find server name for address 192.168.0.1: Non-existent domain *** Default servers are not available Server: UnKnown Address: 192.168.0.1 Non-authoritative answer: Name: www.rehash.com Address: 127.0.0.1 <----- Whoops Your domain is pointed to 127.0.0.1.


5

No. You need a full blown DNS server to do this.


5

yes of course, 127.0.0.1 is always available. It is the "localhost", pointing to the machine itself without going to a real net. It is the address of the loopback device and it is present even if no net card is installed (on every modern OS at least). 192.168.x.x is a set of 256 C classes for internal use (see RFC1918) so you can have 65k hosts (as if it ...



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