Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Anyway, nslookup uses a nameserver in order to resolve a domain/hostname
Other protocols like ping, http etc are looking in the hosts file (/etc/hosts) before asking a nameserver.
If they find an entry about that hostname they are using that in order to connect.
So check /etc/hosts and remove any entry about (www.)domain.local
Then you need to make sure that you nameserver is used as a resolver by your box. You should read your distro's documentation about /etc/resolv.conf, Network Manager or other means your distro is using to define a resolver.
Anyway, nslookup uses a nameserver in order to resolve a domain/hostname
Other protocols like ping, http etc are looking in the hosts file (/etc/hosts) before asking a nameserver.
If they find an entry about that hostname they are using that in order to connect.
So check /etc/hosts and remove any entry about (www.)domain.local
Then you need to make sure that you nameserver is used as a resolver by your box. You should read your distro's documentation about /etc/resolv.conf, Network Manager or other means your distro is using to define a resolver.
I didn't know about the different checks done by ping and nslookup. Thanks for the guidance. I'll take a closer look at my config and post the results.
BTW, I have 2 different NICs. Each one with a different DNS attached to it. Can this be the issue?
I didn't know about the different checks done by ping and nslookup. Thanks for the guidance. I'll take a closer look at my config and post the results.
BTW, I have 2 different NICs. Each one with a different DNS attached to it. Can this be the issue?
No I don't think this has something to do with your issue, but you can try ping and dig with your hostname in order to see how it's resolved by the 2 utilities:
No I don't think this has something to do with your issue, but you can try ping and dig with your hostname in order to see how it's resolved by the 2 utilities:
ping www.domain.local
PING domain.local (172.17.70.1) 56(84) bytes of data.
64 bytes from MASTER (172.17.70.1): icmp_seq=1 ttl=64 time=0.055 ms
64 bytes from MASTER (172.17.70.1): icmp_seq=2 ttl=64 time=0.111 ms
64 bytes from MASTER (172.17.70.1): icmp_seq=3 ttl=64 time=0.079 ms
64 bytes from MASTER (172.17.70.1): icmp_seq=4 ttl=64 time=0.079 ms
ping domain.local
ping: domain.local: Name or service not known
PING domain.local (172.17.70.1) 56(84) bytes of data.
64 bytes from MASTER (172.17.70.1): icmp_seq=1 ttl=64 time=0.055 ms
64 bytes from MASTER (172.17.70.1): icmp_seq=2 ttl=64 time=0.111 ms
64 bytes from MASTER (172.17.70.1): icmp_seq=3 ttl=64 time=0.079 ms
64 bytes from MASTER (172.17.70.1): icmp_seq=4 ttl=64 time=0.079 ms
ping domain.local
ping: domain.local: Name or service not known
You didn't say your distro, so we cannot know if you're using Network Manager or other network tool.
What's in /etc/hosts and /etc/resolv.conf (or whatever file your resolver is using!)
AFAIK ubuntu uses avahi with a .local domain, so maybe that's the reason of this mess in dns name resolution!
I don't use ubuntu, but I've this post why using a .local domain is a bad idea.
Also re. your network config you should put your nameserver first and google second in /etc/resolv.conf, so your box uses the local dns resolver to resolve a fake domain (like .local or whatever) that your nameserver is authoritative for.
AFAIK ubuntu uses avahi with a .local domain, so maybe that's the reason of this mess in dns name resolution!
I don't use ubuntu, but I've this post why using a .local domain is a bad idea.
Also re. your network config you should put your nameserver first and google second in /etc/resolv.conf, so your box uses the local dns resolver to resolve a fake domain (like .local or whatever) that your nameserver is authoritative for.
Indeed commenting out the 8.8.8.8 server solved some issues.
Now I'll try to change my domain to another different from .local.
AFAIK ubuntu uses avahi with a .local domain, so maybe that's the reason of this mess in dns name resolution!
I don't use ubuntu, but I've this post why using a .local domain is a bad idea.
Also re. your network config you should put your nameserver first and google second in /etc/resolv.conf, so your box uses the local dns resolver to resolve a fake domain (like .local or whatever) that your nameserver is authoritative for.
Hi!
I put my nameserver fix and that seemed to solve some issues. Also, after changing .local to .here domain, everything seemed to work as expected.
Quote:
Originally Posted by MadeInGermany
Generic host lookups are done according to the hosts: line in /etc/nsswitch.conf
"files" means /etc/hosts.
and you'll see it is a binary plugin for the hostname resolution, corresponding to a "myhostname" in /etc/nsswitch.conf
The man page is just a description what it does.
Likewise, a description of /etc/nsswitch.conf is in
Code:
man nsswitch.conf
Code:
getent hosts myhostname
getent hosts myipaddress
shows what the hostname resolution yields.
Knowing how it works is the first step in finding a solution.
Last edited by MadeInGermany; 12-04-2023 at 02:35 AM.
and you'll see it is a binary plugin for the hostname resolution, corresponding to a "myhostname" in /etc/nsswitch.conf
The man page is just a description what it does.
Likewise, a description of /etc/nsswitch.conf is in
Code:
man nsswitch.conf
Code:
getent hosts myhostname
getent hosts myipaddress
shows what the hostname resolution yields.
Knowing how it works is the first step in finding a solution.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.