LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices



Reply
 
Search this Thread
Old 03-06-2012, 02:22 PM   #1
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,982
Blog Entries: 1

Rep: Reputation: 83
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.
 
Old 03-06-2012, 02:26 PM   #2
Thor_2.0
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,227
Blog Entries: 23

Rep: Reputation: 279Reputation: 279Reputation: 279
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
 
Old 03-06-2012, 02:40 PM   #3
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,982
Blog Entries: 1

Original Poster
Rep: Reputation: 83
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).
 
Old 03-06-2012, 04:10 PM   #4
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,982
Blog Entries: 1

Original Poster
Rep: Reputation: 83
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.
 
Old 03-06-2012, 04:28 PM   #5
Skaperen
Senior Member
 
Registered: May 2009
Location: WV, USA
Distribution: Slackware, CentOS, Ubuntu, Fedora, Timesys, Linux From Scratch
Posts: 1,777
Blog Entries: 20

Rep: Reputation: 116Reputation: 116
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.
 
Old 03-06-2012, 05:02 PM   #6
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,982
Blog Entries: 1

Original Poster
Rep: Reputation: 83
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).
 
Old 03-06-2012, 05:10 PM   #7
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,982
Blog Entries: 1

Original Poster
Rep: Reputation: 83
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?
 
Old 03-06-2012, 05:17 PM   #8
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,982
Blog Entries: 1

Original Poster
Rep: Reputation: 83
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.
 
Old 03-06-2012, 05:19 PM   #9
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,982
Blog Entries: 1

Original Poster
Rep: Reputation: 83
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.
Old 03-06-2012, 05:28 PM   #10
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,982
Blog Entries: 1

Original Poster
Rep: Reputation: 83
I should be able to thank myself, don't you think? :-)
 
Old 03-06-2012, 07:24 PM   #11
Skaperen
Senior Member
 
Registered: May 2009
Location: WV, USA
Distribution: Slackware, CentOS, Ubuntu, Fedora, Timesys, Linux From Scratch
Posts: 1,777
Blog Entries: 20

Rep: Reputation: 116Reputation: 116
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 07:27 PM.
 
  


Reply

Tags
dn, dns, non-standard, ping


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
I have ping request timeout manuel19 Linux - Hardware 1 05-18-2010 08:46 AM
request timeout when we ping IP mizan Linux - Hardware 1 10-17-2009 12:17 PM
webserver doesn't reply to external request but it reply's to local request ziba Linux - Server 4 05-11-2009 06:27 PM
DNS lookup doesn't work, ping, firefox will not work properly lovemov Linux - Networking 2 04-23-2009 03:30 PM
LAN/ADSL Router ping working but DNS ping fails R N Ghosh Linux - Networking 1 01-13-2006 08:44 AM


All times are GMT -5. The time now is 05:05 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration