LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 07-09-2007, 10:52 AM   #1
eelgueta
LQ Newbie
 
Registered: Jul 2007
Posts: 3

Rep: Reputation: 0
Unhappy dig @ works, dig doesn't


Hi All,

When I do

Code:
dig @10.0.0.2 microsoft.com
I get this:

Code:
; <<>> DiG 9.3.3rc2 <<>> @10.0.0.2 microsoft.com
; (1 server found)
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 45745
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 5, ADDITIONAL: 5

;; QUESTION SECTION:
;microsoft.com.                 IN      A

;; ANSWER SECTION:
...... blah blah
However, if I do

Code:
dig microsfot.com
I get:

Code:
; <<>> DiG 9.3.3rc2 <<>> microsoft.com
;; global options:  printcmd
;; connection timed out; no servers could be reached
My config files are:

Code:
/etc/resolv.conf
10.0.0.2
10.0.0.10
164.77.246.10

/etc/host.conf
order hosts,bind

/etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1    mercurio.mydomain.local mercurio localhost.localdomain localhost
Any ideas?

This is our mail server, and is not sending any mail because of this name resolution problem. So any help, is GREATLY welcomed.

Ed.
 
Old 07-09-2007, 02:08 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
have you messed about with /etc/nsswitch.conf? normally there is an entry in there, "hosts files dns" to define how to resolve names.
 
Old 07-09-2007, 02:13 PM   #3
fur
Member
 
Registered: Dec 2003
Distribution: Debian, FreeBSD
Posts: 310

Rep: Reputation: 35
Thats strange.

By not including "@10.0.0.2" dig should use the default server in /etc/resolv.conf.

Seeing how the first listed server is 10.0.0.2 it is odd it cant lookup.


The only thing I can think of is if the file permissions on /etc/resolv.conf are too restrictive.

If its not set to,

-rw-r--r--


Then try to "chmod 644 /etc/resolve.conf"
 
Old 07-09-2007, 03:45 PM   #4
eelgueta
LQ Newbie
 
Registered: Jul 2007
Posts: 3

Original Poster
Rep: Reputation: 0
Thumbs up Solved

Thanks acid_kewpie and fur,

I did a

Code:
service NetworkManager start
and the problem is solved (I saw it was turned off). Don't know why. I don't even know what NetworkManager is.

For the record, I haven't messed with /etc/nsswitch.conf. The pertinent line reads:

Code:
hosts:      files dns
Anyway, any idea about what was going on?

Ed.
 
Old 07-09-2007, 03:48 PM   #5
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
hmm, no idea off hand what networkmanager would've done there. it will rewrite resolv.conf but if you said what it did there, shouldn't be any different. what does it look like now?
 
Old 07-09-2007, 05:25 PM   #6
eelgueta
LQ Newbie
 
Registered: Jul 2007
Posts: 3

Original Poster
Rep: Reputation: 0
it looks like before, no change.
 
Old 07-09-2007, 06:45 PM   #7
fur
Member
 
Registered: Dec 2003
Distribution: Debian, FreeBSD
Posts: 310

Rep: Reputation: 35
I think it was a file permission problem. If you chmod 600 /etc/resolv.conf you will see the same results. As a user running dig it wont be able to read resolv.conf and just timeout.

I'm not familiar with networkmanager, but acid_kewpie said it will rewrite resolv.conf. My guess is that by starting that service it fixed the permission problem by writing a new file with the proper permissions.
 
  


Reply



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
dig drumltd Linux - Networking 5 11-05-2006 08:19 AM
About dig command and others satimis Linux - Networking 2 09-25-2006 01:43 AM
host vs dig jpbarto Linux - Networking 2 08-06-2003 10:17 AM
netbios yes; dig no; ? odious1 Linux - Networking 2 07-11-2003 09:49 AM
dig andox Linux - Security 1 07-05-2003 08:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:08 PM.

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
Open Source Consulting | Domain Registration