[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Question about Solaris DNS client name resolution

Posted on 2006-11-08
12
Medium Priority
?
407 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 200 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 200 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 38

Accepted Solution

by:
yuzh earned 200 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 200 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 200 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 200 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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.
Suggested Courses

650 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