Say I have a domain name "my.domain.com" with an A Record that resolves to the public IPv4 address (say 160.200.200.21) of my server (running Ubuntu 20.04)
I've installed BigBlueButton on the server and almost everything is fine except that BigBlueButton needs to be able to reach itself from the domain name or public IP and there it fails and gives this error:
curl: (28) Failed to connect to port 443: Connection timed out
# Error: Could not connect to the configured hostname/IP address
So i have done the following checks:
- Used
netcat -l
on port 80 and 443 with a remote server to make sure the ports are opened => SUCCESS
also the following commands i ran:
~# curl https://my.domain.com
curl: (28) Failed to connect to my.domain.com port 443: Connection timed out
~# curl my.domain.com
curl: (28) Failed to connect to my.domain.com port 80: Connection timed out
~# wget https://my.domain.com
--2023-11-07 20:08:51-- https://my.domain.com/
Resolving my.domain.com (my.domain.com)... 160.200.200.21
Connecting to my.domain.com (my.domain.com)|160.200.200.21|:443... failed: Connection timed out.
Retrying.
But curl http://google.com
responds!
Also note that the commands above work perfectly from another server or computer
~# netstat -anltp | grep :80
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 4082/nginx: master
tcp 0 0 127.0.0.1:52562 127.0.0.1:8021 ESTABLISHED 13903/node
tcp6 0 0 :::80 :::* LISTEN 4082/nginx: master
tcp6 0 0 :::8021 :::* LISTEN 13262/freeswitch
tcp6 0 0 127.0.0.1:8090 :::* LISTEN 13076/java
tcp6 0 0 127.0.0.1:32800 127.0.0.1:8021 ESTABLISHED 13745/java
tcp6 0 0 127.0.0.1:8021 127.0.0.1:32800 ESTABLISHED 13262/freeswitch
tcp6 0 0 127.0.0.1:8021 127.0.0.1:52562 ESTABLISHED 13262/freeswitch
~# netstat -anltp | grep :443
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 12628/haproxy
tcp6 0 0 :::443 :::* LISTEN 12628/haproxy
At this point I don't know what to check again or where to look for the problem. This server is a virtual machine, provided by a provider so i only have ssh and root access provider said it was behind a firewall, but since the ports are clearly opened I don't know if they can be blamed.
So what is happening is my.domain.com is perfectly reachable outside the server(on browser or CLI) but not within the server even though the relevant ports are opened.
one thing I found weird, maybe the info will be useful: when I did netcat -l 80
on my server it worked even though Nginx was running on port 80. netcat -l 443
failed saying port is in use, i had to first shutdown the process using it before i could run the test.
If your VM cannot reach itself through an external connection, you can modify /etc/hosts to map one of the net adapter IP addresses (even localhost) to the DNS name of the machine. These configurations take precedence over the ones in external DNS.