LinuxQuestions.org
Help answer threads with 0 replies.
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 09-20-2012, 04:18 AM   #1
m4rtin
Member
 
Registered: Sep 2007
Posts: 261

Rep: Reputation: 16
Question understanding "domain" option in /etc/resolv.conf


In /etc/resolv.conf file one can specify domain option which should refer to local domain name. According to resolv.conf manual "Most queries for names within this domain can use short names relative to the local domain.". In case of such /etc/resolv.conf file:

Code:
domain linuxquestions.org
nameserver 8.8.8.8
..the "ping www" command resolves to www.linuxquestions.org. However, if I add the search option, "ping www" command resolves to www.linux.org:

Code:
domain linuxquestions.org
nameserver 8.8.8.8
search linux.org
Is the domain ignored if the search option is specified? Are there any other reasons for domain option in /etc/resolv.conf file other than resolving hostnames to FQDN?
 
Old 09-20-2012, 06:20 AM   #2
cpasqualini
Member
 
Registered: Dec 2010
Location: Concordia, Entre Ríos, Argentina
Distribution: Debian
Posts: 46

Rep: Reputation: 5
very good question m4rtin!!
i've never ask that to myself.

i use
Code:
domain example.tld
search example.tld
nameserver 8.8.8.8
nameserver 8.8.4.4
but never take the time to look at the difference of domain vs search...

i'll look at this thread too!

thanks!
 
Old 09-20-2012, 02:52 PM   #3
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,020

Rep: Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630
http://theos.in/desktop-linux/resolv...linux-example/
 
Old 09-20-2012, 03:16 PM   #4
cpasqualini
Member
 
Registered: Dec 2010
Location: Concordia, Entre Ríos, Argentina
Distribution: Debian
Posts: 46

Rep: Reputation: 5
jefro:

you haven't answered our question:
the link you point talks about the classic resolv.conf:
Code:
search example.com
nameserver 8.8.8.8
nameserver 8.8.4.4
if the idea of search is add example.com behind www

what is the point of having a line with domain, as can be found on the default resolv.conf of many recent distros?

Code:
domain example.com
search example.com
nameserver 8.8.8.8
nameserver 8.8.4.4
 
Old 09-20-2012, 08:09 PM   #5
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,020

Rep: Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630
I believe the article addresses this case.


"search cyberciti.biz
nameserver 202.54.1.10
nameserver 202.54.1.11"

Where

"search domain.com: The search list is normally determined from the local domain name; by default, it contains only the local domain name. So when you type nslookup www, it will be matched to www.cyberciti.biz"
 
Old 09-25-2012, 09:43 AM   #6
m4rtin
Member
 
Registered: Sep 2007
Posts: 261

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by jefro View Post
I believe the article addresses this case.


"search cyberciti.biz
nameserver 202.54.1.10
nameserver 202.54.1.11"

Where

"search domain.com: The search list is normally determined from the local domain name; by default, it contains only the local domain name. So when you type nslookup www, it will be matched to www.cyberciti.biz"
Is the domain option ignored if the search option is specified? If yes, then what is the reason to use domain configuration option in /etc/resolv.conf file in case search is specified as well?

Last edited by m4rtin; 09-25-2012 at 09:44 AM.
 
Old 09-25-2012, 10:27 AM   #7
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, I think that quote DOES explain it. It certainly looks like the domain option is ignored for searches in an alternative search value is specified. I *presume* this is a legacy issue, and the search management logic was added in later on without breaking compatibility.

So just DON'T specify a search value and the domain option is totally valid.

Personally I would have thought the searches would be searched after the domain value is searched, but if it's coded differently then so be it I guess.
 
  


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
"domain-name" and "host-name" options in dhcpd.conf m4rtin Linux - Server 3 09-20-2012 08:21 AM
unpredictable "delete" "move to trash" or "cut" file menu option dorianrenato Linux - General 3 11-28-2011 06:41 PM
the "default" ( as we have in grub.conf ) option of lilo.conf ??? b0nd Linux - Newbie 4 09-14-2005 05:51 AM
dhcpd.conf "option routers" non fixed TroelsSmit Linux - Networking 1 08-11-2005 04:31 AM
dns named.conf: "view" unknown option rioguia Linux - Networking 16 11-02-2004 11:04 AM

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

All times are GMT -5. The time now is 07:02 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