Host localhost not found: 3(NXDOMAIN)

castris

Verified User
Joined
Apr 16, 2021
Messages
16
Location
Arcenillas
Hi.

I have inherited a system with Directadmin and ubuntu 20.04

When going to install wiki.js I ran into a MySQL accessibility problem.

The reason is that the software does not detect or validate the configuration for accessing the database.

After verifying in the shell that the data was correct, note that the user cannot access via localhost in said software, but in the shell he can.

When checking, I saw a localhost resolution problem

Bash:
# host localhost
Host localhost not found: 3(NXDOMAIN)

Checking the /etc/hosts file​

Bash:
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost localhost.localdomain
127.0.1.1 server-myhost


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

Checking /etc/nsswitch.conf​

Code:
hosts:          files dns
networks:       files

Any ideas?
 

castris

Verified User
Joined
Apr 16, 2021
Messages
16
Location
Arcenillas
Of course no.

127.0.1.1 is a private net.

Full file (of course public ip is fake)
Code:
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost localhost.localdomain
127.0.1.1 server-myhost


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

bdacus01

Verified User
Joined
Jul 22, 2017
Messages
2,970
Location
Murfreesboro
Of course no.
To what question?

Full file (of course public ip is fake)
I am not asking for your IP address. I am trying determine is the server on the internet? OR are you saying its a LAN based install?

127 is a loopback notation and is confusing if you are trying not to show a real IP or not I would use some other notation. like ###.###.###.###
 

castris

Verified User
Joined
Apr 16, 2021
Messages
16
Location
Arcenillas
Ok.

Sorry for my english.

1. Server is a server on Internet. Not local.
2. Configuration of hosts is correct for one server on internet

Question is on post.

If running a command host with parameters localhost get error.
Code:
host localhost
Host localhost not found: 3(NXDOMAIN)

Correct execution must return
Code:
# host localhost
localhost has address 127.0.0.1
localhost has IPv6 address ::1

With this fail thre're some servidor (daemons) that can get error.

For server if run
Code:
# host myhost.server.com
myhost.server.com has address 1.1.8.8 # Of course is fake number ip

Is information correct? Any more for you?
 

bdacus01

Verified User
Joined
Jul 22, 2017
Messages
2,970
Location
Murfreesboro
Sorry for my english.
My Spanish would be worse no problem. Let me add beautiful country..

Also @SeLLeRoNe here on Forum is a native to your country. He is a very good Admin

So if you go here
Code:
https://intodns.com/
put in your domain

do any errors jump out at you?
 

castris

Verified User
Joined
Apr 16, 2021
Messages
16
Location
Arcenillas
Hi

- domain has not any problem with resolution.
- hostname resolve ok inside and outside of server.
- Not issues with domain resolution on any domain or subdomain on server.


Issue is WITH internal question about localhost

nslookup, dig, intodns and any probe work fine for resolver domain and FDQN hostname.

UNIQUE problem is

Code:
host localhost
Host localhost not found: 3(NXDOMAIN)


Apreciate help of @SeLLeRoNe
 

Richard G

Verified User
Joined
Jul 6, 2008
Messages
6,484
Location
Maastricht
127.0.0.1 localhost localhost.localdomain
Since everything else is resolving fine as you say..... What if you put this in the correct order and restart your network (or better, restart the server)?

Correct order should be:
127.0.0.1 localhost.localdomain localhost
 
Top