Domain refers to the local machine - dns

Just was walking around till I tried to ping a domain .
But I surprised that it was the domain of the localhost !
I went to see what the wrong was , and how this domain set itself .
However,I didn't find anything that related to it in the localhost OS !
I tried to ping it via online ping service , and the surprise is here , it pings the localhost of the service host !
The domain is :
securitytube.com
Is there any explanation ?

This should be migrated to superuser but the answer to your question is because the owners of that domain have an IP address of 0.0.0.0 set...
$host securitytube.com
securitytube.com has address 0.0.0.0
securitytube.com mail is handled by 0 mail.happyisp.com.
$ping securitytube.com
PING securitytube.com (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost.localdomain (127.0.0.1): icmp_seq=1 ttl=64 time=0.089 ms
Most linux boxes will presume that's the loop-back address (Hence return 127.0.0.1) Windows boxes appear to not do anything other than error out.
c:\ping 0.0.0.0
Pinging 0.0.0.0 with 32 bytes of data:
PING: transmit failed. General failure.

Related

".local" suffix on local server (Manjaro)

I recently changed my Linux distribution (Manjaro) and my local domains defined in /etc/hosts and ending in .local no longer work.
# /etc/hosts
# Host addresses
127.0.0.1 localhost
127.0.0.1 hello.local
127.0.0.1 hello.domain.local
127.0.0.1 hello.other
$ ping hello.local
ping: hello.local: Nom ou service inconnu
$ ping hello.other
PING hello.other (127.0.0.1) 56(84) octets de données.
64 octets de localhost (127.0.0.1) : icmp_seq=1 ttl=64 temps=0.012 ms
...
$ ping hello.domain.local
PING hello.domain.local (127.0.0.1) 56(84) octets de données.
64 octets de localhost (127.0.0.1) : icmp_seq=1 ttl=64 temps=0.012 ms
...
This doesn't work only with a sub-domain of the tld .local : hello.local.
If it's a sub-sub domain : hello.domain.local , it works.
Also if the tld is not (.local) but .other : hello.other, it works.
where did I miss something?
Firstly, backup your nsswitch.conf ->
sudo cp /etc/nsswitch.conf /etc/nsswitch.conf.bk
Then, goo to /etc/nsswitch.conf and
replace this line
hosts: mymachines mdns4_minimal [NOTFOUND=return] resolve [!UNAVAIL=return] files myhostname dns
to
hosts: files mdns4_minimal [NOTFOUND=return] dns

On Ubuntu 18.04, i cannot access Tomcat from a browser using IP address

I've installed Tomcat 9 on Ubuntu 18.04(VM). I cannot access tomcat using IP address from a browser (or curl)
On the VM, tomcat is running and curl http://1.2.3.4:8080 works.
But the same externally does not..
l-OSX: hal$ curl https://10.51.253.163:8080 -v
* Rebuilt URL to: https://10.51.253.163:8080/
* Trying 10.51.253.163...
* connect to 10.51.253.163 port 8080 failed: Operation timed out
* Failed to connect to 10.51.253.163 port 8080: Operation timed out
Tomcat's server.xml
<Engine name="Catalina" defaultHost="10.51.253.163">
...
<Host name="10.51.253.163" appBase="webapps"
unpackWARs="true" autoDeploy="true">
UFW is Inactive
sudo ufw status verbose`
Status: inactive`
Ping to the VM works
l-OSX: hal$ ping 10.51.253.163
PING 10.51.253.163 (10.51.253.163): 56 data bytes
64 bytes from 10.51.253.163: icmp_seq=0 ttl=58 time=111.914 ms
64 bytes from 10.51.253.163: icmp_seq=1 ttl=58 time=93.793 ms
Appreciate any help on this!
After some research and help from IT Support team, i was able to resolve this as below:
VM > Manage Security
Add Security Rule
Allow Port: 8080 on Protocol: TCP
Able to access Tomcat from browser.

Pinging local domain returns unknown IPv6

I have a weird problem I can't solve due to my lack of knowledge.
I have a local server running Dnsmasq. On my computer (Windows 10) I have Acrylic DNS Proxy which directs all requests ending with .local to the local server. It works great, however one domain respons with an unknown IPv6 address.
> ping testdomain.local
Pinging TESTDOMAIN [IPv6 address] with 32 bytes of data:
Reply from IPv6 address: time<1ms
I can't figure out why testdomain.local is reversed to TESTDOMAIN. All my other local domains respons as expected:
> ping testdomain2.local
Pinging testdomain2.local [local server address] with 32 bytes of data:
Reply from local server address: bytes=32 time<1ms TTL=64

Why does Node.js/Express not accept connections from localhost?

I encountered this strange behavior today I could not find a cause for. I am using MacOS Sierra.
I have this code (Express):
app.server.listen(config.port, config.address, function () {
logger.info('app is listening on', config.address + ':' + config.port);
});
And it prints
app is listening on 127.0.0.1:5000
How ever, if I try to curl, it fails.
$ curl http://localhost:5000/api/ping
curl: (56) Recv failure: Connection reset by peer
I checked my hosts file:
$ cat /etc/hosts
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
So I ping localhost to make sure it resolves to 127.0.0.1:
$ ping localhost
PING localhost (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.061 ms
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.126 ms
64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.135 ms
^C
--- localhost ping statistics ---
3 packets transmitted, 3 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.061/0.107/0.135/0.033 ms
I try again, but it fails
$ curl http://localhost:5000/api/ping
curl: (56) Recv failure: Connection reset by peer
Now I try to use 127.0.0.1 instead and voila, it works?
$ curl http://127.0.0.1:5000/api/ping
pong
What's wrong?
cURL is trying to connect via IPv6 but your Express server is listening on 127.0.0.1 which is IPv4.
You can force cURL to connect via IPv4 with the -4 option.
curl -4 http://127.0.0.1:5000/api/ping

Host name not being resolved properly in CentOS

I am running CentOS on a virtual machine. My /etc/hosts file is as follows:
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.50.17 192-168-50-17.openstacklocal 192-168-50-17
192.168.50.13 slave5
/etc/resolv.conf:
; generated by /sbin/dhclient-script
search openstacklocal
nameserver 192.168.50.3
nameserver 8.8.8.8
nameserver 8.8.4.4
All pings are working properly. However, when I am trying to run the following command -
/usr/lib64/lustre/tests/llmount.sh, this is what I am getting:
Loading modules from /usr/lib64/lustre/tests/..
detected 1 online CPUs by sysfs
libcfs will create CPU partition based on online CPUs
debug=vfstrace rpctrace dlmtrace neterror ha config ioctl super lfsck
subsystem_debug=all -lnet -lnd -pinger
Formatting mgs, mds, osts
Format mds1: /tmp/lustre-mdt1
Format ost1: /tmp/lustre-ost1
mkfs.lustre: Cannot resolve hostname '192-168-50-17#tcp'.
mkfs.lustre: exiting with 1 (Operation not permitted)
I am running it as the root user. Any help on fixing this would be appreciated. Thanks!
Why does your /etc/hosts file have what looks like an IP address with dashes (-) instead of dots (.)? You probably just need to delete these lines from the (or the entire) /etc/hosts file.

Resources