When the computer is not connected to the Internet, launching the MinGW 64 (MSYS2) console requires more than one minute (and also compiling with gcc becomes very slow).
My computer (windows 7 pro) is not joined to any Active Directory.
When the computer is connected to the Internet, everything is fine.
What is the reason? Is There a way to fix it?
I found that the file C:\windows\system32\drivers\etc\hosts had an odd entry before the standard 127.0.0.1 localhost entry:
127.0.0.1 mytest
127.0.0.1 localhost
Deleting the first (or placing the 127.0.0.1 localhost first) solved the problem.
Related
In an Ubuntu 20 or 22 LTS, if I attempt to use a hostname like anyname.localhost it always seems to resolve to IPv6 ::1 address.
In an old RHEL 6, if I attempt to use a hostname like anyname.localhost it always seems to resolve to IPv4 127.0.0.1 address.
In a MS-Windows or MacOS 12.6 machine, this does not seem to happen. (It only happens if I manually edit /etc/hosts and manually add an host alias to 127.0.0.1
127.0.0.1 localhost localhost.localdomain somename.localhost
)
Is this any.sequence.of.names.localhost resolution to ::1 (localhost) always garanteed to happen ? By what reason ? In what Linux distros ?
I have a few projects where it seems useful to have many localhost aliases without having to edit /etc/hosts, but I searched about TCP and DNS quirks, and found nothing about this behaviour. (Not very sure what I should search for). Not sure if I can depend on this behaviour.
Well, thanks to the link posted in the comments above by Patrick Mevzek, I could reach a documented explanation.
For the Ubuntu 20/22 LTS, it seems to use systemd-resolved for DNS resolution.
And, as it says on
https://www.freedesktop.org/software/systemd/man/systemd-resolved.service.html
Synthetic Records
...
The hostnames "localhost" and "localhost.localdomain" as well as any hostname ending in ".localhost" or ".localhost.localdomain" are resolved to the IP addresses 127.0.0.1 and ::1.
So, this seems to explain that Linux OSes that have DNS resolution based on systemd will have this behaviour, and others (like Windows and MacOS) do not.
(So, this seemed a systemd question after all :-)
(This question is in fact a duplicate of https://serverfault.com/questions/1065513/how-does-linux-resolve-wildcard-locahost-subdomains-e-g-ping-test-localhost/1065514#1065514 - just using systemd-resolved instead of nss-myhostname , and if anyone knows how to link them both ways, could help others searching by other words).
Apologize in front, maybe the situation here is a bit complicated. I searched everywhere online but couldn't find a perfect solution, plus I have tried almost all the solutions mentioned in other posts.
Situation:
So I have a postgreSQL database installed in a Ubuntu system. The system is actually a virtual machine on the VMware workstation 12, which is installed on Windows 7 professional. Now I am trying to remotely access the postgreSQL database through my MacBook pro 2013.
In the Mac terminal, the command line I tried is:
psql -U postgres -h xxx.xxx.xxx.xx
"xxx.xxx.xxx.xx" represents the IP address of the Windows 7 machine. The result is a failure:
psql: could not connect to server: Operation timed out
Is the server running on host "169.254.121.2" and accepting
TCP/IP connections on port 5432?
What I have done:
Edited the pg_hba.conf file to include
host all all 0.0.0.0/0 md5
Edited the postgresql.conf to include
listen_addresses='*'
Restarted postgres service.
Disabled firewall on the host.
I checked by running the psql command locally and it worked. Also, on the same VMware I have other Ubuntu systems. They are all fine to connect and access the data in this Ubuntu system.
Running Nmap, the output is
PORT STATE SERVICE
5432/TCP open postgresql
What's next? Anything else I can try? Any advice is highly appreciated and please let me know if anything above is ambiguous. I will clarify for better diagnosis. Thank you all!
Somehow managed to get it working..
So when I ran "Nmap" on the other Ubuntu system towards this one, it does shows
PORT STATE SERVICE
5432/TCP open postgresql
However, when I ran "Nmap" on my Mac, it's a different port, 3389, which is mainly used for Windows remote desktop. So what I did was to check the network configuration of this Ubuntu virtual machine from "bridged" to "NAT" and did a port forwarding to 5432. It is working fine now..
I read in some places saying that VMware favors bridged whereas VirtualBox favors NAT+port forwarding. I am quite confused as it is certain not the case in my situation. Maybe I am wrong.
I have been given a centos server to lauch eclipse orion code editor. I installed eclipse orion as per the instruction on https://wiki.eclipse.org/Orion/How_Tos/Install_Orion_on_Localhost (steps for linux using jetty server). It works fine on centos browser. The centos os is running on 198.168.1.226. So that I can access the following urls on web browser of centos.
198.168.1.226:8080
localhost:8080
127.0.0.1:8080
0.0.0.0:8080
But when I tried to access the 198.168.1.226:8080 from other local machines on local network, that is not accessible. I searched the StackOverflow Questions like how to make jetty server accessible from LAN? and Unable to access jetty server with local IP address but both are useless for me. How can I fix this situation? Can I fix it editing the code on orion.ini file or need to deal with configuration file or something else?
I have also tried the orion for windows computer but it worked itself for accessing the orion system for any other computer in local network. But I am surprised to face it on centos using the jetty server for setting up eclipse-orion system .
First of all check that have you allowed specific port (8080) from eclispse.
add rule with that port no. in centos iptables as below:-
iptables -A INPUT -p tcp --dport 8080 (adjust according your port no.) -j ACCEPT
The great mystery. I have an Express/Node (v4.2.2) JS app running on OS X El Capitan. The app is running on port 4444. If I run the app, I'm able to get the proper response back with the following commands:
curl localhost:4444 -> Works
curl [::1]:4444 -> Works
curl api.q.com:4444 -> Works
However, I have a problem with:
curl 127.0.0.1:4444 -> Doesn't Work; Responds with curl: (52) Empty reply from server
127.0.0.1:4444 fails in all browsers as well. Even more astonishing, api.q.com:4444 works in all browsers EXCEPT for Chrome.
My /etc/hosts file:
127.0.0.1 localhost web.q.com api.q.com qrm.q.com fhr.q.com
::1 localhost
fe80::1%lo0 localhost
I've tried resetting my /etc/hosts file back to the default and flushed my DNS cache. I have a feeling it might be the app, but I'm not sure what the cause could be. Any suggestions?
Turns out, it had something to do with a Linux VM I set up in Virtual Box. My /etc/hosts file was the same on that VM (maybe that was the issue?).
I disabled the VM and everything worked again. I have no idea what the cause was, but I'm going to close this question. If anyone else has this issue, I can only suggest look at any VMs you may have running locally. Thanks again!
I am working on a CentOS 6.4 64-bit, as root. I am trying to set up the system snmpd agent, so that it listens on a port other than 161, e.g. 8001. I successfully got that on Debian 7.x by just changing the port number in /etc/snmp/snmpd.conf:
agentAddress udp:127.0.0.1:8001
and restarting the service with /etc/init.d/snmpd restart. It was straightforward. However, I tried several things but I didn't manage to do that on CentOS, i.e. snmpd will fail to start.
These are the last two lines written in /var/log/messages when I try to run it with that line in snmpd.conf:
Oct 13 15:47:40 localhost snmpd[4775]: Error opening specified endpoint "udp:127.0.0.1:8001"
Oct 13 15:47:40 localhost snmpd[4775]: Server Exiting with code 1
On the other hand, if I run the program directly, it will start and will happily open port 8001:
/usr/sbin/snmpd udp:127.0.0.1:8001
or:
/usr/sbin/snmpd udp:8001
Both ways work.
I have googled and read about /etc/sysconfig/snmpd, but adding some options in this file did not work either. For info, I disabled iptables (ipdatables -F).
Could anybody help me on this?
Thanks in advance,
Antonio