• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 410
  • Last Modified:

Question about Solaris DNS client name resolution

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
pzxkys
Asked:
pzxkys
  • 5
  • 2
  • 2
  • +1
6 Solutions
 
pzxkysAuthor Commented:
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
 
bpeterseCommented:
Have you edited the nsswitch.conf yet?  You can change the order in which 'files' or 'dns' is referenced there.  
0
 
TintinCommented:
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
Learn to develop an Android App

Want to increase your earning potential in 2018? Pad your resume with app building experience. Learn how with this hands-on course.

 
yuzhCommented:
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
 
pzxkysAuthor Commented:
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
 
bpeterseCommented:
Why not rename defaultdomain and see if it fails then? That would answer your question wouldn't it?
0
 
pzxkysAuthor Commented:
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
 
TintinCommented:
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
 
pzxkysAuthor Commented:
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
 
yuzhCommented:
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
 
pzxkysAuthor Commented:
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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 5
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now