1833074 Members
8407 Online
110049 Solutions
New Discussion

DNS resolving NFS mount

 
Linda Lux
Regular Advisor

DNS resolving NFS mount

I have an NFS server mount point on my HP 11.0

the mount command is this:

mount -o soft z:z_drive /Z &

I have the IP address of the z_drive in my hosts file.
If the IP address of this z_drive should change in the future, how can I have it so the DNS server resolves this with out changing my hosts file?

DNS ip address is in my hosts file.

would my command be

mount -o soft thenameofdnsserver:path /Z ????

Linda
If it isn't one thing, it's another
5 REPLIES 5
Steven E. Protter
Exalted Contributor

Re: DNS resolving NFS mount

nslookup thenameofdnsserver

if it works you are okay.

If it does not, you have two choices:
1) Correct the issue until it resolves. You can use DNS resolution and create a dns record for the server and set /etc/nsswitch.conf to resolve dns first.
2) Put the ip address of the server in the /etc/fstab file or script.

2 Is easy. 1 might uncover some configuration issues that you want to resolve anyway.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Linda Lux
Regular Advisor

Re: DNS resolving NFS mount

in my hosts file I have

10.6.2.130 z z_drive

so in my mount command I have
mount -o soft z:z_drive path

I am asking what do I replace the
"z:z_drive" with in the command?

my nsswitch.conf has:

hosts: files [NOTFOUND=continue] dns

and my resolv.conf has:

domain K460.americanid.com
nameserver 192.168.1.5
nameserver 192.168.1.44 this is dns server
nameserver 192.168.1.30

On the actual DNS server I am uncertain what the path is, di I need to know that?

Linda





If it isn't one thing, it's another
Pete Randall
Outstanding Contributor

Re: DNS resolving NFS mount

Linda,

Your mount command is fine as it is. If the IP address changes, your hosts file entry will be wrong, but your nsswitch file tells it to look to DNS only if it can't find the entry in hosts. To solve this you would want nsswitch to check DNS first, then, as long as someone has made the correct entry in DNS, you should resolve fine.


Pete

Pete
Mel Burslan
Honored Contributor

Re: DNS resolving NFS mount

acording to your nsswitch.conf you are in good shape as long as at least one of the dns servers listed in your resolv.conf file can resolve the ip address of this z_drive name.
if your dns servers are not in the same domain as z_drive and your host which mounts the nfs mount point, you may consider to add the domain suffix to your z_drive name to make it fully qualified, but under some bizzare circumstances, I have seen this domain suffix causing mount failures. So, use it if and when needed.

Right now, you do not need to change anything. In the future, after ip address of zz_drive gets changed, you need to make sure it is no longer in your etc hosts file (if not, since files is the first thing your hosts checks for dns resolution, it will fail) and you may need to add a domain suffix to this name, i.e., something like :

mount -o soft z_drive.subdomain.domain.com:/path_to_directory /Z

if the z_drive only doesn't work.

Hope this helps
________________________________
UNIX because I majored in cryptology...
Linda Lux
Regular Advisor

Re: DNS resolving NFS mount

I did get it to work, I had a netadmin give me the name of this on the dns server and plugged that into my command and it worked

Thanks to all who responded


Linda
If it isn't one thing, it's another