Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
03-06-2012, 01:22 PM
#1
Senior Member
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092
Rep:
ping doesn't make a dns request
I'm trying to figure out why ping (and probably the whole ns system) is not asking to resolve one name to the configured DNS servers.
I have a hunch that it's because the name I'm trying to resolve is using a non-standard root domain name.
For example:
Code:
antoranz@pingui:~$ ping whatever.xxxxxxxxx.local
ping: unknown host whatever.xxxxxxxxx.local
It fais after a couple of seconds, by the way. And in wireshark I don't see any dns traffic going out.
If it's because of the "local", where can I set the permitted root domain names? Thanks in advance.
---------- Post added 03-06-12 at 04:23 PM ----------
Oh.... and I forgot to say that if I try with dig, the DNS request does go out and the name is resolved correctly.
03-06-2012, 01:26 PM
#2
Senior Member
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,766
Hi,
What's the contents of /etc/resolv.conf ?
If there are no nameservers set there, my gues is that (some) stuff on your box will not use DNS...
Just a thought...
Thor
03-06-2012, 01:40 PM
#3
Senior Member
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092
Original Poster
Rep:
DNS servers are set there (as a matter of fact, when I make the dig request I don't set the DNS server so it uses the ones in /etc/resolv.conf).
03-06-2012, 03:10 PM
#4
Senior Member
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092
Original Poster
Rep:
A little more feedback, this is the strace result around the time when the timeout happens:
Code:
_llseek(3, 0, 0xbfb849c8, SEEK_CUR) = -1 ESPIPE (Illegal seek)
write(3, "RESOLVE-HOSTNAME-IPV4 yyyy.xxxx."..., 38) = 38
read(3, "-15 Timeout reached\n", 4096) = 20
close(3) = 0
munmap(0xb77fe000, 4096) = 0
write(2, "ping: unknown host yyyy.xxxx.loc"..., 35ping: unknown host plata.cps.local
) = 35
exit_group(2) = ?
strace stops for some seconds on the read(3, .... then it finishes printing "-15 Timeout...."). I suppose there's a funcion call that should return either the final result of the name resolution or (as in this case), an error.
03-06-2012, 03:28 PM
#5
Senior Member
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,684
Rep:
What is the contents of /etc/nsswitch.conf ?
The strace output shown is incomplete. Maybe the DNS query is elsewhere?
If you do not see DNS traffic "go out" maybe it is because the name server is local, or there is no route for the name server IP address.
Watch ALL IP traffic, including local (you can limit it to just port 53), and store the complete strace output. Something might be in there.
03-06-2012, 04:02 PM
#6
Senior Member
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092
Original Poster
Rep:
Code:
# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc-reference' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.
passwd: compat
group: compat
shadow: compat
hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4
networks: files
protocols: db files
services: db files
ethers: db files
rpc: db files
netgroup: nis
Code:
$ strace ping yyyyy.xxx.local
execve("/bin/ping", ["ping", "yyyyy.xxx.local"], [/* 46 vars */]) = 0
brk(0) = 0x8909000
fcntl64(0, F_GETFD) = 0
fcntl64(1, F_GETFD) = 0
fcntl64(2, F_GETFD) = 0
access("/etc/suid-debug", F_OK) = -1 ENOENT (No such file or directory)
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7845000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=76757, ...}) = 0
mmap2(NULL, 76757, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7832000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/i386-linux-gnu/libc.so.6", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0p\222\1\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=1544392, ...}) = 0
mmap2(NULL, 1554968, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x110000
mmap2(0x286000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x176) = 0x286000
mmap2(0x289000, 10776, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x289000
close(3) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7831000
set_thread_area({entry_number:-1 -> 6, base_addr:0xb78318d0, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0
mprotect(0x286000, 8192, PROT_READ) = 0
mprotect(0x8050000, 4096, PROT_READ) = 0
mprotect(0xb9f000, 4096, PROT_READ) = 0
munmap(0xb7832000, 76757) = 0
socket(PF_INET, SOCK_RAW, IPPROTO_ICMP) = -1 EPERM (Operation not permitted)
getuid32() = 1000
setuid32(1000) = 0
brk(0) = 0x8909000
brk(0x892a000) = 0x892a000
getpid() = 26358
open("/etc/resolv.conf", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=123, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7844000
read(3, "# Generated by NetworkManager\ndo"..., 4096) = 123
read(3, "", 4096) = 0
close(3) = 0
munmap(0xb7844000, 4096) = 0
stat64("/etc/resolv.conf", {st_mode=S_IFREG|0644, st_size=123, ...}) = 0
open("/etc/resolv.conf", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=123, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7844000
read(3, "# Generated by NetworkManager\ndo"..., 4096) = 123
read(3, "", 4096) = 0
close(3) = 0
munmap(0xb7844000, 4096) = 0
socket(PF_FILE, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 3
connect(3, {sa_family=AF_FILE, path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory)
close(3) = 0
socket(PF_FILE, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 3
connect(3, {sa_family=AF_FILE, path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory)
close(3) = 0
open("/etc/nsswitch.conf", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=513, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7844000
read(3, "# /etc/nsswitch.conf\n#\n# Example"..., 4096) = 513
read(3, "", 4096) = 0
close(3) = 0
munmap(0xb7844000, 4096) = 0
open("/etc/ld.so.cache", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=76757, ...}) = 0
mmap2(NULL, 76757, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7832000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/i386-linux-gnu/libnss_files.so.2", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\340\32\0\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=46736, ...}) = 0
mmap2(NULL, 49880, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x64d000
mmap2(0x658000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xa) = 0x658000
close(3) = 0
mprotect(0x658000, 4096, PROT_READ) = 0
munmap(0xb7832000, 76757) = 0
open("/etc/host.conf", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=92, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7844000
read(3, "# The \"order\" line is only used "..., 4096) = 92
read(3, "", 4096) = 0
close(3) = 0
munmap(0xb7844000, 4096) = 0
open("/etc/hosts", O_RDONLY|O_CLOEXEC) = 3
fcntl64(3, F_GETFD) = 0x1 (flags FD_CLOEXEC)
fstat64(3, {st_mode=S_IFREG|0644, st_size=221, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7844000
read(3, "127.0.0.1\tlocalhost\n127.0.1.1\tpi"..., 4096) = 221
read(3, "", 4096) = 0
close(3) = 0
munmap(0xb7844000, 4096) = 0
open("/etc/ld.so.cache", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=76757, ...}) = 0
mmap2(NULL, 76757, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7832000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/libnss_mdns4_minimal.so.2", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\0\10\0\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=9580, ...}) = 0
mmap2(NULL, 12388, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xdad000
mmap2(0xdaf000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1) = 0xdaf000
close(3) = 0
mprotect(0xdaf000, 4096, PROT_READ) = 0
munmap(0xb7832000, 76757) = 0
socket(PF_FILE, SOCK_STREAM, 0) = 3
fcntl64(3, F_GETFD) = 0
fcntl64(3, F_SETFD, FD_CLOEXEC) = 0
connect(3, {sa_family=AF_FILE, path="/var/run/avahi-daemon/socket"}, 110) = 0
fcntl64(3, F_GETFL) = 0x2 (flags O_RDWR)
fstat64(3, {st_mode=S_IFSOCK|0777, st_size=0, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7844000
_llseek(3, 0, 0xbfdda7d8, SEEK_CUR) = -1 ESPIPE (Illegal seek)
write(3, "RESOLVE-HOSTNAME-IPV4 yyyyy.xxx."..., 38) = 38
read(3, "-15 Timeout reached\n", 4096) = 20
close(3) = 0
munmap(0xb7844000, 4096) = 0
write(2, "ping: unknown host yyyyy.xxx.loc"..., 35ping: unknown host yyyyy.xxx.local
) = 35
exit_group(2) = ?
And there's no dns traffic. I'm sniffing with wireshark "udp and port 53" on the right interface (which does show traffic when using dig).
03-06-2012, 04:10 PM
#7
Senior Member
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092
Original Poster
Rep:
I'm checking the strace of the domain with local and a domain with com at the end.
The traces look very simillar until it reaches this part on the local trace:
Code:
socket(PF_FILE, SOCK_STREAM, 0) = 3
fcntl64(3, F_GETFD) = 0
fcntl64(3, F_SETFD, FD_CLOEXEC) = 0
connect(3, {sa_family=AF_FILE, path="/var/run/avahi-daemon/socket"}, 110) = 0
fcntl64(3, F_GETFL) = 0x2 (flags O_RDWR)
fstat64(3, {st_mode=S_IFSOCK|0777, st_size=0, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb787f000
_llseek(3, 0, 0xbf8f90f8, SEEK_CUR) = -1 ESPIPE (Illegal seek)
write(3, "RESOLVE-HOSTNAME-IPV4 yyyyy.xxx."..., 38) = 38
read(3, "-15 Timeout reached\n", 4096) = 20
close(3) = 0
But on the one with "com" instead of local I see this:
Code:
open("/etc/ld.so.cache", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=76757, ...}) = 0
mmap2(NULL, 76757, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb77d1000
close(3) = 0
What do you think? Could it be something dealing with avahi?
03-06-2012, 04:17 PM
#8
Senior Member
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092
Original Poster
Rep:
Taken from /etc/avahi/hosts:
Code:
# Examples:
# 192.168.0.1 router.local
# 2001::81:1 test.local
Seems like I'll have to tweek avahi so that it doesn't resolve .local names or something like that. Let's see what I can do.
Thanks for your help. When I have the solution in place, I'll let you know.
03-06-2012, 04:19 PM
#9
Senior Member
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092
Original Poster
Rep:
Effectively shutting down avahi makes the dns request go through normally and now name resolution is working. J!
I'll dig (pun intended) for other possible hacks.
1 members found this post helpful.
03-06-2012, 04:28 PM
#10
Senior Member
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092
Original Poster
Rep:
I should be able to thank myself, don't you think? :-)
03-06-2012, 06:24 PM
#11
Senior Member
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,684
Rep:
Well, now I know to not run avahi. Oh wait ... it is running. But I guess it's only an issue with XXXX.local names. But thanks for revealing what it has been up to.
Last edited by Skaperen; 03-06-2012 at 06:27 PM .
All times are GMT -5. The time now is 06:59 PM .
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know .
Latest Threads
LQ News