The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Special Forums > IP Networking
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 05-21-2008
uunniixx uunniixx is offline
Registered User
 

Join Date: May 2008
Posts: 8
Below are my personal findings:


Example 1:

> host nyustern-.collegemailer.com
nyustern-.collegemailer.com has address 209.200.118.155

> host nyustern.collegemailer.com
nyustern.collegemailer.com has address 209.200.118.155

Example 2:

> nslookup nyustern-.collegemailer.com
Note: nslookup is deprecated and may be removed from future releases.
Consider using the `dig' or `host' programs instead. Run nslookup with
the `-sil[ent]' option to prevent this message from appearing.
Server: xx.xxx.xx.xxx
Address: xx.xxx.xx.xxx#xx

Non-authoritative answer:
Name: nyustern-.collegemailer.com
Address: 209.200.118.155

> nslookup nyustern.collegemailer.com
Note: nslookup is deprecated and may be removed from future releases.
Consider using the `dig' or `host' programs instead. Run nslookup with
the `-sil[ent]' option to prevent this message from appearing.
Server: xx.xxx.xx.xxx
Address: xx.xxx.xx.xxx#xx

Non-authoritative answer:
Name: nyustern.collegemailer.com
Address: 209.200.118.155


Eample 3:

This code uses gethostbyname_r method to determine the address:-

> a.out nyuster-n.collegemailer.com
addresses: 209.200.118.155
> a.out ny-uster-n.collegemailer.com
addresses: 209.200.118.155
> a.out ny-uster-n-.collegemailer.com
unknown host `ny-uster-n-.collegemailer.com'
> a.out ny---uster-n.collegemailer.com
addresses: 209.200.118.155
> a.out nyustern.collegemailer.com
addresses: 209.200.118.155
>

I am unsure whether '-' in hostname ignored or does not has a functionality. In such a case having a trailing '-' is just a corner off case.

Last edited by uunniixx; 05-25-2008 at 02:16 PM.
Reply With Quote