Solved

Question about Solaris DNS client name resolution

Posted on 2006-11-08
12
404 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 
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
 
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello fellow BSD lovers, I've created a patch process for patching openjdk6 for BSD (FreeBSD specifically), although I tried to keep all BSD versions in mind when creating my patch. Welcome to OpenJDK6 on BSD First let me start with a little …
In tuning file systems on the Solaris Operating System, changing some parameters of a file system usually destroys the data on it. For instance, changing the cache segment block size in the volume of a T3 requires that you delete the existing volu…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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…

688 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