Monday, April 29, 2024
 Popular · Latest · Hot · Upcoming
4
rated 0 times [  4] [ 0]  / answers: 1 / hits: 33566  / 2 Years ago, wed, january 26, 2022, 1:26:06

I'm setting up a local network and have configured a DNS server. I can resolve hostnames by querying the DNS server, but no programs can look them up.



I uninstalled libnss-mdns and removed avahi-daemon and even rebooted afterwards.



Here are some examples:



root@cloud2:~# host ns.example.com
ns.example.com has address 10.10.10.100
root@cloud2:~# ping ns.example.com
ping: unknown host ns.example.com

root@cloud2:~# grep hosts /etc/nsswitch.conf
hosts: files dns


my ntp server is configured for ns.example.com, but all I get is nxdomain on ntpq



any ideas?



EDIT:



This also applies to external DNS entries. I have my router both as a DNS forwarder on the custom DNS server and as an entry in resolvconf.



E.G.



root@cloud2:~# host google.com | head
google.com has address 74.125.225.65
google.com has address 74.125.225.66
google.com has address 74.125.225.67
google.com has address 74.125.225.68
google.com has address 74.125.225.69
google.com has address 74.125.225.70
google.com has address 74.125.225.71
google.com has address 74.125.225.72
google.com has address 74.125.225.73
google.com has address 74.125.225.78
root@cloud2:~# traceroute google.com
google.com: Temporary failure in name resolution
Cannot handle "host" cmdline arg `google.com' on position 1 (argc 1)

More From » dns

 Answers
0

This was on Ubuntu server 12.04 LTS and Ubuntu 12.04 LTS



Thanks all for the help. Turns out to be a result of a difference in the way host and the glibc resolver read /etc/resolv.conf.



I was managing resolv.conf with a puppet module that edited the appropriate files in /etc/resolvconf/resolv.conf.d/.



Said puppet module resulted in an /etc/resolv.conf that looked like this:



 nameserver 10.10.10.100
nameserver 192.168.3.100
nameserver 10.10.10.1

search example.com


with a space at the beginning of each line. After removing these spaces, I was able to resolve with both ping and manual lookups (host/nslookup/etc...)



I could've sworn that I've had those spaces on other OSes with no issues, but I just tried on a SL6.3 box and it caused the same behavior.



Thanks for your help and sorry for the trouble!


[#33070] Friday, January 28, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
sipwing

Total Points: 245
Total Questions: 100
Total Answers: 118

Location: Aland Islands
Member since Thu, Oct 22, 2020
4 Years ago
sipwing questions
Sun, May 29, 22, 22:00, 2 Years ago
Fri, Jun 24, 22, 08:46, 2 Years ago
Fri, Dec 23, 22, 00:04, 1 Year ago
;