Skip to content

unix ip adress , dns entries , nslookup – a new oracle dba reference





A new oracle dba can follow below article which is a discussion about what happens when a user connects to a unix machine , how an ip adress is assigned to the user and how the unix server looks up the corresponding name for the ip adress and it also discusses about various terms like nslookup etc so it will give you a good idea on how these things work in an unix operating system.

Let me try to sum what was facts we have:
You have users that dial into your network and are given an IP address from a DHCP server.   Now, from the UNIX server, you wish to ping a user’s PC, I am assuming by name.

To begin with, your network must have at least a primary DNS server.  This DNS server would have to have static entries in it for each ip address mapping it to a name.
Next, the UNIX server must point to this DNS server which is done through the file /etc/resolv.conf
Next, we need to check the /etc/nsswitch.conf to see the order in which the UNIX server tries name service files.  

Assuming the previous items are in order, I do not see any issue.
The user PC dials into your network and is given an IP address from the DHCP server.  Your DNS server, which is separate from the DHCP server should have name-to-ip address translations for all addresses.  Thus, if a user dials in, hangs up, then dials in again, you would need to know the new IP address the user was assigned to know what name the IP address has.  Once you know this, from the UNIX system, you can ping with that name.

I have not set up DHCP/DDNS on our server yet, but I will soon. Something to also think about is DNS caching. Maybe the unix DNS server is caching the first Ip assigned, and while DDNS is assigning a new Ip every time, all name to IP resolution requests are being given the first IP. I will look into turning off DNS caching Completely off.  I think you can do this by setting the time to live option to 0. Thus, forcing the DNS daemon to read the tables in order to provide an answer.

A quick way to find out if you are caching the old ip address is do an nslookup hostname. The result will show you what the DNS server gets from a dns lookup against that hostname.

I setup a test Solaris box on Intel, and neglected to install DNS or NIS.   Is there a way to add DNS after the install?   (I.E. I have no resolve.conf to edit to add my DNS servers.)

you can add packages using pkgadd, but if you are just after a /resolve.conf to edit, you just create it.
vi /etc/resolv.conf
you may also need to edit your /etc/nsswitch.conf, so the system knows to use dns and not just /etc/hosts, change the line
hosts files
to
hosts files dns
or
hosts dns files
depending on wether u want the local host file or the dns servers querying first

I have already edited the nss file to hosts dns files.   I’ll try manually creating the resolv.conf.   What is the expected format of the resolv.conf?

You could do a sys-unconfig .  That should allow you to configure your settings.

domain mydomain.com
nameserver dns_server1
nameserver dns_server2

what are the 3 files to setup on solaris for dns

  1. nsswitch.conf
    2. resolve.conf
    3. defaultrouter

 

I have a problem with my Solaris 9 installation. Basically I have installed solaris 9 on a netra the setup went smoothly without any problems. Now that its running I am seening some very strange problems.

Basically I can ping and see remote sites if I enter the IP address, but if I enter their hostnames I recieve a "cannot find" message. I know that it could mean that it is a DNS setup problem, but I have done the same thing on all other netras and they work fine. I look into messages and there isn’t anything I can see, that relates to this problem. Can any one please help?

In addition the other problem is that I can’t create my home directory it keeps saying: "mkdir: Failed to make directory "/home/jo"; Operation not applicable". Again there isn’t anything in messages. The two problems are very different but they amount to an unstable installation.

BTW I have reinstalled the server twice allready and recieve the same problem each time.

DNS: What is in /etc/resolv.conf?

home dir: Looks like you have auotmountd enable (mount nfs home directories in /home), if you dont want this disable auotmountd

Thanks about the /etc/resolve.conf. Basically I sorted out my network problem. I accidentally saved the file as /etc/resolve.conf instead of /etc/resolv.conf.

Within /etc/resolve.conf I have search field in whihc I have written the domains as follows:

search example.com test.com

but for some strange reason its not reading the search field, any ideas?

Thanks in advance for your help.

the domains listed at search are those added to plain hostnames, example
  www
becomes
  www.example.com
if www is not found

Also keep in mind that some resolver expect one line per domain in resolv.conf, like

  search example.com
  search test.com

have solaris machine. I want to check what is the IP address configured in the PC & what is the DNS IP configured in that PC…

What is the command I should use to check this

:
2:
ifconfig -a
echo | nslookup

 

\

Bind is based on version 9 which means that the configfilenames have changed from earlier.

You need one /etc/named.conf
This file lists the domains and the filenames for
config of each domain.

Example:
options {
        DIRECTORY "/var/named";
};
zone "." in {
        type master;
        file "named.root";
};
zone "bsd.se" in {
        type master;
        file "bsd.zone";
};
zone "13.176.192.in-addr.arpa" in {
        type master;
        file "bsd.rzone";
};
zone "127.in-addr.arpa" in {
        type master;
        file "loopback-domain-info";
};  

The you need to create these files in /var/named
named.root you can get from your isp

bsd.zone ( change to "yourzone".zone
Example:
 
; /var/named/bsd.zone file for zunny (bsd.se.) domain server
; This file resolves hostnames to IP addresses in the bsd.se. domain.
;

@       IN SOA  zunny.bsd.se.   root.zunny.bsd.se. (
        8               ; serial number
        10800           ; refresh (3hrs)
        3600            ; retry (1hr)
        432000          ; expire (5days)
        86400 )         ; ttl (1day)

;
; Nameservers for this domain
;

         IN      NS      zunny.bsd.se. ; primary
         IN      NS      bunny8.solaris.bsd.se. ; secondary
;
;Glue records
:
bunn;Nameserver section for sub-domain-servers
;
solaris.bsd.se.     IN      NS      bunny8.solaris.bsd.se.
bunny8.solaris      IN      A       192.176.14.2

linux.bsd.se.       IN      NS      linux1.linux.bsd.se.
linux1.linux.bsd.se. IN      A       192.176.15.2

; Host Information Section
;

zunny                   IN      A       192.176.13.1
                        IN      A       192.176.14.1
                        IN      A       192.176.15.1
zunny-li                IN      A       192.176.15.1
zunny-so                IN      A       192.176.14.1
punny.se.               IN      A       192.176.13.10

bsd.se.         IN      MX 10   zunny.bsd.se.
                                                           y8.solaris.bsd.se.  IN      A       192.176.14.2

localhost.          IN      A       127.0.0.1  

Ypu also need a reverszone infofile like /var/named/bsd.rzone

Example:

   ; /var/named/bsd.rzone file for zunny (bsd.se.) domain server
; This file resolves IP addresses to hostnames in the bsd.se. domain.
;

@                IN SOA zunny.bsd.se. root.zunny.bsd.se. (
        5                ; serial number
        10800            ; refresh (3hrs)
        3600             ; retry (1hr)
        432000           ; expire (5days)
        86400 )          ; ttl (1day)

                IN NS   zunny.bsd.se. ; primary
                IN NS   bunny8.solaris.bsd.se. ; secondary

1               IN      PTR     zunny.bsd.se.

14.176.192.in-addr.arpa. IN  NS     bunny8.solaris.bsd.se.
2.14.176.192.in-addr.arpa. IN PTR   bunny8.solaris.bsd.se.

15.176.192.in-addr.arpa.  IN  NS      linux1.linux.bsd.se.
2.15.176.192.in-addr.arpa.IN  PTR     linux1.linux.bsd.se.

1.14.176.192.in-addr.arpa. IN PTR zunny-so.solaris.bsd.se.  
1.15.176.192.in-addr.arpa. IN PTR zunny-li.linux.bsd.se.
       

And finally you nedd a fdile for the loopbackdomain
/var/named/loopback-domain-info

Example:
; /var/named/loop.back file for domain nameserver.
;
; Example file for the bsd domain nameserver.
;
;
; Start of Authority section
;

@               IN SOA zunny.bsd.se. root.zunny.bsd.se. (
                4       ; version number
                10800           ; refresh (3hrs.)
                3600            ; retry (1hr.)
                432000          ; expire (5days)
                86400 )         ; ttl (1day)

                IN NS zunny.bsd.se.
1               IN PTR localhost.bsd.se.  

Notice that these examples are for a server that has one slave ( bunny8) for the bsd domain and 2 underdomains
solaris.bsd   and
linux.bsd

Just remove these entrys if you have a flat domain.

It usually doesnt work the first few tries so remember:
increase the serialnumber in the configfile when you make a change,
send a pkill -HUP named  to make the new changes known

use a pkill -INT to get a  named_dump.db file of the cache
in /var/named. Here you can see your config,serialnumbers etc.

Hope it helps, have fun.

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

Post a Comment

You must be logged in to post a comment.