LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 02-25-2010, 03:26 AM   #1
junust
Member
 
Registered: Jul 2008
Location: Israel Ramat Gan
Distribution: CentOs 5.3, SuSe 11.1, Solaris 9, Slackware 13
Posts: 81

Rep: Reputation: 15
'dig' resolving


Hi,

Code:
root@localshot:/etc/rc.d# host dc3
dc3.test.com has address 192.168.1.2

Code:
root@localhost# nslookup dc3
Server:         192.168.1.100
Address:        192.168.1.100#53

Name:   dc3.test.com
Address: 192.168.1.2
BUT

Code:
root@localhost:/etc/rc.d# dig dc3

; <<>> DiG 9.4.3-P3 <<>> dc3
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 60864
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;dc3.                          IN      A

;; Query time: 0 msec
;; SERVER: 192.168.1.100#53(192.168.1.100)
;; WHEN: Thu Feb 25 17:19:03 2010
;; MSG SIZE  rcvd: 22
Code:
cat /etc/resolv.conf
search test.com
nameserver 192.168.1.100

Why 'dig', could not resolve name to IP, whereas 'host' and 'nslookup' could...


tested on RHEL5 and Slackware 13
 
Old 02-25-2010, 03:44 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 12,293

Rep: Reputation: 1698Reputation: 1698Reputation: 1698Reputation: 1698Reputation: 1698Reputation: 1698Reputation: 1698Reputation: 1698Reputation: 1698Reputation: 1698Reputation: 1698
Hi,

By default dig ignores the search/domain directive in /etc/resolv.conf. If you want to use it add "+search" option in your command:
Code:
dig dc3 +se
Regards
 
1 members found this post helpful.
Old 02-25-2010, 03:59 AM   #3
junust
Member
 
Registered: Jul 2008
Location: Israel Ramat Gan
Distribution: CentOs 5.3, SuSe 11.1, Solaris 9, Slackware 13
Posts: 81

Original Poster
Rep: Reputation: 15
Thanks...


I added $HOME/.digrc (+search option)to do stuff permanent

Last edited by junust; 02-25-2010 at 04:19 AM.
 
  


Reply


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] nslookup, host, dig not resolving entries in /etc/hosts MensaWater Linux - Networking 21 09-30-2016 08:43 AM
dig @ works, dig doesn't eelgueta Linux - Networking 6 07-09-2007 07:45 PM
dig drumltd Linux - Networking 5 11-05-2006 09:19 AM
/etc/hosts resolving before DNS resolving ? markraem Linux - Networking 4 11-02-2003 05:54 AM
dig andox Linux - Security 1 07-05-2003 09:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:17 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration