07-07-2009
I would use $(hostname) instead of $HOSTNAME
I have systems too where $HOSTNAME is not set, but the hostname command works always
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hello,
I am installing redhat linux 6.2 on an intel based system. Whether i want to know any naming conventions should i follow.
ie Any convention to follow to name a linux machine(To give hostname). Simillarly for domain name also. Please suggest in this regard (1 Reply)
Discussion started by: bache_gowda
1 Replies
2. IP Networking
Using Solaris 8 (or WINXP).
I am trying to look up a specific DNS hostname, but I don't know which DNS server houses that entry. How can I find the hostname?
nslookup gives me the following:
C:\>nslookup hostname
Server: dnsserver
Address: x.x.x.x
*** dnsserver can't find hostname:... (2 Replies)
Discussion started by: dangral
2 Replies
3. UNIX for Dummies Questions & Answers
Hello,
I am new to Solaris.
I am using stand alone Solaris 10.0 for test/study purpose and connecting to internet via an ADSL modem which has DHCP server. My Solaris is working on VMWare within winXP. My WinXP and Solaris connects to internet by the same ADSL modem via its DHCP at the same... (1 Reply)
Discussion started by: XNOR
1 Replies
4. UNIX for Dummies Questions & Answers
Hi,
I am using hostname environment variable in my shell script to print the host name but it's printing nothing.Can you please help me on this.
Please find the part of the code pasted here:
llist=
llist=$(ps -ef | grep -v grep | grep -c "$1")
echo "Hostname is ${hostname}" (7 Replies)
Discussion started by: gbiswal
7 Replies
5. UNIX for Dummies Questions & Answers
Hi,
I am trying to run some SQL scripts under the UNIX server using BTEQ. When I try to create a log file, the file gets populated only to the point where I log into BTEQ.
The log file for the running of the actual script does not seem to be stored.
Would any one know ehy this could be... (3 Replies)
Discussion started by: zsrinathz
3 Replies
6. SCO
from the hostname command I get this:
scosysv.mycompany0
when I ping scosysv.mycompany0 i get 64.158.xx.xx which fails with 100% packet loss.
/etc/hosts shows
199.199.199.1 scosysv scosysv.mycompany0 scosysv.mycompany0.com
when I ping the hostname value isn't the local IP 199.199.199.1... (6 Replies)
Discussion started by: bbxguy
6 Replies
7. Emergency UNIX and Linux Support
Hi All,
So we added a new HP-UX 11.31 machine. Copied OS via Ignite-UX (DVD)over from this machine called machine_a. It was supposed to be named machine_c. And it is when you log in...however when I'm in the ILO console before logging in, it says:
It should say:
What gives? And how do... (4 Replies)
Discussion started by: zixzix01
4 Replies
8. AIX
Hi all,
I ended up replacing a failed disk drive on my power 7. I had a few issues with unmirroring as it had a stale logical volume. I ended up finally getting it to unmirror the rootvg. I had an empty space in slot 3 so I ended up putting the new disk in slot 3. It configured to hdisk0 with no... (2 Replies)
Discussion started by: AlexanderIII
2 Replies
9. UNIX for Advanced & Expert Users
deleted (0 Replies)
Discussion started by: hce
0 Replies
10. Web Development
Hi,
I know how to populate a combo box or a drop down list box which I do as under :
Query that gets the data for the drop down box :
$qry = "select \"EmployeeID\" AS empid, \"FirstName\"::text || ' ' ||\"LastName\"::text as name from \"Employees\"";
$qq =... (1 Reply)
Discussion started by: terrykhatri531
1 Replies
LEARN ABOUT LINUX
hostname
HOSTNAME(7) Linux Programmer's Manual HOSTNAME(7)
NAME
hostname - hostname resolution description
DESCRIPTION
Hostnames are domains, where a domain is a hierarchical, dot-separated list of subdomains; for example, the machine monet, in the Berkeley
subdomain of the EDU subdomain of the Internet would be represented as
monet.Berkeley.EDU
(with no trailing dot).
Hostnames are often used with network client and server programs, which must generally translate the name to an address for use. (This
task is generally performed by either getaddrinfo(3) or the obsolete gethostbyname(3).) Hostnames are resolved by the Internet name
resolver in the following fashion.
If the name consists of a single component, that is, contains no dot, and if the environment variable HOSTALIASES is set to the name of a
file, that file is searched for any string matching the input hostname. The file should consist of lines made up of two white-space sepa-
rated strings, the first of which is the hostname alias, and the second of which is the complete hostname to be substituted for that alias.
If a case-insensitive match is found between the hostname to be resolved and the first field of a line in the file, the substituted name is
looked up with no further processing.
If the input name ends with a trailing dot, the trailing dot is removed, and the remaining name is looked up with no further processing.
If the input name does not end with a trailing dot, it is looked up by searching through a list of domains until a match is found. The
default search list includes first the local domain, then its parent domains with at least 2 name components (longest first). For example,
in the domain CS.Berkeley.EDU, the name lithium.CChem will be checked first as lithium.CChem.CS.Berkeley.EDU and then as
lithium.CChem.Berkeley.EDU. Lithium.CChem.EDU will not be tried, as there is only one component remaining from the local domain. The
search path can be changed from the default by a system-wide configuration file (see resolver(5)).
SEE ALSO
gethostbyname(3), resolver(5), mailaddr(7), named(8)
COLOPHON
This page is part of release 3.27 of the Linux man-pages project. A description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
Linux 2008-06-11 HOSTNAME(7)