Solved

Question about Solaris DNS client name resolution

Posted on 2006-11-08
12
391 Views
Last Modified: 2013-12-27
I'm stumped. We have a solaris network that uses both DNS and NIS. For the moment they both have the same domain name (aaa.bbb.com). I need to change the default DNS domain name. I edited resolv.conf and changed it to ccc.ddd.com. I then tested resolution of a host in the original domain. My test : nslookup host1.aaa.bbb.com. As I expected nslookup failed to resolve the name. I then tried ping host1 and expected name resolution failure but was surprised to see that host1 was resolved and the ip address was pinged. Got the same result with telnet host1. Success when I expected failure. I see that these 2 DNS client applications do not use the domain name in resolv.conf as their default. I cleared nscd cache and stopped nscd. The info isn't / wasn't cached. I checked /etc/hosts. Host1 isn't defined there. I now suspect /etc/defaultdomain which still has aaa.bbb.com in it. I understand that NIS is using this file for its default domain information. How can I force the DNS client applications to look elsewhere for their default domain name?

Thanks! Marty
0
Comment
Question by:pzxkys
  • 5
  • 2
  • 2
  • +1
12 Comments
 

Author Comment

by:pzxkys
ID: 17899385
Correction to my original post :-). Where I said I tested nslookup host1.aaa.bbb.com ... I should have said I tested "nslookup host1" ... the point, of course, was to see if nslookup would add the default domain aaa.bbb.com. It obviously tacked on the new default domain ccc.ddd.com from resolv.conf as expected ... and failed because there currently is no such domain.
0
 
LVL 6

Assisted Solution

by:bpeterse
bpeterse earned 100 total points
ID: 17901965
Have you edited the nsswitch.conf yet?  You can change the order in which 'files' or 'dns' is referenced there.  
0
 
LVL 48

Assisted Solution

by:Tintin
Tintin earned 100 total points
ID: 17902100
Did you update your DNS server to serve the new domain name?

Does /etc/resolv.conf contain:

search aaa.bbb.com
nameserver 1.2.3.4


0
 
LVL 38

Accepted Solution

by:
yuzh earned 100 total points
ID: 17903089
You need to make sure your /etc/resolv.conf

  has the correct DND server infor, eg:
  nameserver 123.123.20.5
  search aaa.bbb.com

  replace "123.123.20.5" with your DNS server IP

And:
   
check your /etc/nsswitch.conf  file, and make sure hosts use dns:

hosts:     files dns [NOTFOUND=continue]
                     ^
# you can just modify the record to make it use files and DNS

0
 

Author Comment

by:pzxkys
ID: 17905294
Thanks for the feedback.

The resolv.conf entry of ccc.ddd.com is a bogus one for testing purposes only. I want to prove that "ping host1" is not attaching aaa.bbb.com to the hostname for IP address discovery. So our DNS server does not need the new domain name. And /etc/resolv.conf has "domain ccc.ddd.com" as the first entry, followed by IP addresses for servers of the other domain aaa.bbb.com.

My nsswitch.conf file has
hosts:      files nis dns

I have no entry for host1 in /etc/hosts. I removed all entries for host1 from the NIS hosts file and if the ping application uses resolv.conf for a domain name it gets the bogus one. Name resolution for host1 should work its way through each of these entries and fail. Right?

Any chance it's getting the domain name aaa.bbb.com from /etc/defaultdomain? My goal is to make "ping host1" fail but for now it continues to come up with an IP address. Why?
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 6

Assisted Solution

by:bpeterse
bpeterse earned 100 total points
ID: 17906362
Why not rename defaultdomain and see if it fails then? That would answer your question wouldn't it?
0
 

Author Comment

by:pzxkys
ID: 17906783
Good point ... and I sort of did this already but the results were not pleasing :-). I used the "domainname" command to change the system domainname that I believe is used by NIS. So far as I know the domainname value is read from /etc/defaultdomain at boot time.

When I changed "domainname" at a command prompt it did NOT modify the contents of /etc/defaultdomain. It did, however, break my NIS connection, my e-mail connection and the ping host1 command. It does, in fact, seem that ping gets its domain name from whatever data or environment variable is holding the domainname data ...

I guess I was hoping that some expert :-) who really understands how all this stuff works would just explain it to me. It's my understanding that /etc/defaultdomain is the ultimate source of the default NIS domain. I need to be able to leave that alone ... so my NIS domain does not change. My DNS domain, on the other hand, must change. They need to be different. Thus I don't think I can fiddle with /etc/defaultdomain ...

Thanks again for the feedback!
0
 
LVL 48

Assisted Solution

by:Tintin
Tintin earned 100 total points
ID: 17909121
OK, I understand better now.

Try changing nsswitch.conf to have

hosts: files nis [SUCCESS=continue] dns

My theory (untested) is that when you do

ping hostname

if will firstly append the default NIS domain, then if this succeeds, it should then continue and try with the default DNS domain.
0
 

Author Comment

by:pzxkys
ID: 17913713
Interesting suggestion. I made the change in nsswitch.conf. I rebooted. I modified aaa.bbb.com in resolv.conf to ccc.ddd.com and ran ping host1. Ping host1 still worked. Not what I was hoping for ...
0
 
LVL 38

Assisted Solution

by:yuzh
yuzh earned 100 total points
ID: 17913746
check if you have host1 define in NIS or DNS.

from:
hosts:      files nis dns

it lookup /etc/hosts, then NIS then DNS !


also
have a look at the output of:

nslookup host1


Have a nice weekend

0
 

Author Comment

by:pzxkys
ID: 18075859
Sorry for the delay on this. I've split the points up and given them to all 3 respondents. No answer was actually adequate. No answer solved the problem. Perhaps the problem/question was too complex. In any case it was easier to share the points that have the question cancelled. Thanks for your effort and assistance!

Oh by the way: I found that if I entered a search list in the resolv.conf file that ping and telnet correctly resolved the target hostname. Still don't understand why exactly.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now