Operating System - HP-UX
1748069 Members
5598 Online
108758 Solutions
New Discussion юеВ

Re: How to know server Full name FQDN

 
ajyeshB
Advisor

How to know server Full name FQDN

Hello everybody,
I want to check the server in Domain or not.
If server is in Domain, then want to check the full name.
if serer is not in domain, then how to add the server in domain.
current OS is HP-UX 11.31

Thanks
Jayesh
5 REPLIES 5
SoorajCleris
Honored Contributor

Re: How to know server Full name FQDN

Hi,

Do you have a configured domain in your network?

Regards,
Sooraj
"UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity" - Dennis Ritchie
Aneesh Mohan
Honored Contributor

Re: How to know server Full name FQDN

You need to add domain name or search order in /etc/resolv.conf

example :-

cat /etc/resolv.conf
domain alahli.com

or

cat /etc/resolv.conf
search alahli.com corp.alahli.com

To get a FQDN.

nslookup hostname
ajyeshB
Advisor

Re: How to know server Full name FQDN

Hi!
I check the file resolv.conf in /etc
but can't find.


nslookup hostname

[root@rajHRDQ]/etc # nslookup
Using /etc/hosts on: rajHRDQ

> RAJHRQD
Using /etc/hosts on: RAJHRQD

looking up FILES
Name: VWVIHRDQ
Address: 192.105.3.175

> exit

So please suggest mem My server is in Domain or not. If not, How to configure?

Thanks
Jayesh
Aneesh Mohan
Honored Contributor

Re: How to know server Full name FQDN


Hi ,
You server is not added with domain name information .

Are you looking for DNS host name resolution in your server ?

If yes then you may need to create /etc/resolv.conf with the below sample entries.


Resolv.conf ( You may need to create if exist)
==========

cat /etc/resolv.conf
domain yahoo.com
nameserver xx.xx.xx.xx ---- > Primary DNS Server
nameserver xx.xx.xx.xx ----- . Second DNS server
nameserver xx.xx.xx.xx -----> Third DNS Server


nsswitch.conf ( You may need to create if not exist)
=============

cat /etc/nsswitch.conf
hosts: dns [NOTFOUND=continue UNAVAIL=continue TRYAGAIN=continue] files [NOTFOUND=return UNAVAIL=continue TRYAGAIN=return]
ipnodes: files


If you just want to local resolution only, then you can add you FQDN enrty in /etc/hosts

Example :-

10.xx.xx.xx server.yahoo.com serverA


Aneesh
Kiran009
New Member

Re: How to know server Full name FQDN

hn=`hostname`
fqdn=`nslookup $hn 2>/dev/null | grep "^Name:" | cut -d ":" -f2`