<br><font size=2 face="sans-serif">Dear Kerberos Support Analyst:</font>
<br>
<br><font size=2 face="sans-serif">At the outset &nbsp;I &nbsp;would like to convey our sincere thanks &nbsp;for providing an excellent support to the &nbsp;IT community &nbsp;on KRB &nbsp;matters.</font>
<br>
<br><font size=2 face="sans-serif">We are currently working on &nbsp;integrating an Oracle product with a Kerberos server. My colleague Jim McBride had written to krbdev@mit.edu &nbsp;and &nbsp;Sam Harman responded with his comments that as long as </font><font size=2 face="Courier New">gethostbyaddr(gethostbyname(gethostname()))</font><font size=2 face="sans-serif"> returns FQDN, things should work fine.</font>
<br>
<br><font size=2 face="sans-serif">Oracle insists that we need to provide the FQDN &nbsp;in the /etc/hosts file and all along we have been telling them that it is not a MUST for us to put the FQDN name in the /etc/hosts &nbsp;files. Although Oracle's argument &nbsp;makes sense in a set-up where DNS is not configured correctly, &nbsp;we all know it, from the Name Service management perspective it is not a good idea to have the FQDN in the /etc/hosts. We should let the resolver &nbsp;libraries &nbsp;take care of the FQDN issues while making sue that the DNS is configured according to the specifications.</font>
<br>
<br><font size=2 face="sans-serif">I am more than &nbsp;convinced that our environment &nbsp;is correctly configured and any &nbsp;application which relies on &nbsp;resolver libraries to derive the FQDN of the host will work correctly in our environment. I do not find it necessary to put the FQDN of &nbsp;the &nbsp;host in &nbsp;/etc/hosts file of the machine ( which makes the DNS set-up meaningless).</font>
<br>
<br><font size=2 face="sans-serif">I wrote a very simple program (fqdn_of_host.c) &nbsp;to demonstrate that the resolver libraries are &nbsp;working &nbsp;correctly in an environment where DNS is setup properly and kerberos applications will work correctly in the same environment.</font>
<br>
<br>
<br><font size=2 face="sans-serif">==================================================================================================</font>
<br><font size=2 face="sans-serif">Some of the AIX commands produce the following results :</font>
<br>
<br><font size=2 face="sans-serif">root@denver $ hostname</font>
<br><font size=2 face="sans-serif">denver</font>
<br>
<br><font size=2 face="sans-serif">root@denver $ host denver</font>
<br><font size=2 face="sans-serif">denver.r2.fs.fed.us is 9.99.15.50</font>
<br>
<br><font size=2 face="sans-serif">root@denver $ nslookup denver</font>
<br><font size=2 face="sans-serif">Server: &nbsp;netsrv.fs.fed.us</font>
<br><font size=2 face="sans-serif">Address: &nbsp;9.99.15.100</font>
<br>
<br><font size=2 face="sans-serif">Name: &nbsp; &nbsp;denver.r2.fs.fed.us</font>
<br><font size=2 face="sans-serif">Address: &nbsp;9.99.15.50</font>
<br>
<br><font size=2 face="sans-serif">root@denver $ nslookup 9.99.15.50</font>
<br><font size=2 face="sans-serif">Server: &nbsp;netsrv.fs.fed.us</font>
<br><font size=2 face="sans-serif">Address: &nbsp;9.99.15.100</font>
<br>
<br><font size=2 face="sans-serif">Name: &nbsp; &nbsp;denver.r2.fs.fed.us</font>
<br><font size=2 face="sans-serif">Address: &nbsp;9.99.15.50</font>
<br>
<br><font size=2 face="sans-serif">root@denver $ ifconfig en0</font>
<br><font size=2 face="sans-serif">en0: flags=e080863&lt;UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT&gt;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; inet 9.99.15.50 netmask 0xffffff00 broadcast 9.99.15.255</font>
<br><font size=2 face="sans-serif"><br>
</font>
<br><font size=2 face="sans-serif">=============================================================================================</font>
<br>
<br><font size=2 face="sans-serif">The /etc/hosts file on denver &nbsp;looks like &nbsp; </font>
<br>
<br><font size=2 face="sans-serif">127.0.0.1 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; loopback localhost &nbsp; &nbsp; &nbsp;# loopback (lo0) name/address</font>
<br><font size=2 face="sans-serif">9.99.15.50 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;denver<br>
=============================================================================================</font>
<br><font size=2 face="sans-serif">The &nbsp;/etc/resolv.conf &nbsp; file on denver &nbsp;looks &nbsp;like</font>
<br>
<br><font size=2 face="sans-serif">nameserver &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;9.99.15.100</font>
<br><font size=2 face="sans-serif">search &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; r1.fs.fed.us &nbsp; r2.fs.fed.us &nbsp; r3.fs.fed.us r6.fs.fed.us &nbsp; boulder.ibm.com &nbsp; &nbsp;ibm.com &nbsp; fs.fed.us </font>
<br><font size=2 face="sans-serif">nameserver &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;9.17.223.121</font>
<br><font size=2 face="sans-serif">=============================================================================================</font>
<br><font size=2 face="sans-serif">The /etc/netsvc.conf &nbsp;file on the machine looks like:</font>
<br>
<br><font size=2 face="sans-serif">hosts=bind4,local</font>
<br><font size=2 face="sans-serif">=============================================================================================</font>
<br><font size=2 face="sans-serif">/* &nbsp; </font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp;Source code for &nbsp; fqdn_of_host.c &nbsp;</font>
<br>
<br><font size=2 face="sans-serif">*/</font>
<br>
<br><font size=2 face="sans-serif">#include &lt;stdio.h&gt;</font>
<br><font size=2 face="sans-serif">#include &lt;strings.h&gt;</font>
<br><font size=2 face="sans-serif">#include &lt;netdb.h&gt;</font>
<br><font size=2 face="sans-serif">#include &lt;sys/types.h&gt;</font>
<br><font size=2 face="sans-serif">#include &lt;sys/socket.h&gt;</font>
<br><font size=2 face="sans-serif">#include &lt;netinet/in.h&gt;</font>
<br><font size=2 face="sans-serif">#include &lt;arpa/inet.h&gt;</font>
<br><font size=2 face="sans-serif">#include &lt;unistd.h&gt;</font>
<br>
<br><font size=2 face="sans-serif">main(argc, argv)</font>
<br><font size=2 face="sans-serif">int argc;</font>
<br><font size=2 face="sans-serif">char *argv[];</font>
<br><font size=2 face="sans-serif">{</font>
<br>
<br><font size=2 face="sans-serif">&nbsp; unsigned char &nbsp; &nbsp; &nbsp; &nbsp; host_name[1024],</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; name[100],</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; *ptr,</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;a[4];</font>
<br>
<br><font size=2 face="sans-serif">&nbsp;static char &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; domain_name[100],</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; addrbuf[32], *ch;</font>
<br>
<br><font size=2 face="sans-serif">&nbsp; int &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; domain_len;</font>
<br>
<br><font size=2 face="sans-serif">&nbsp; struct hostent &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;*hostptr;</font>
<br>
<br><font size=2 face="sans-serif">&nbsp; int &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; i,</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; count,</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ai[4];</font>
<br>
<br><font size=2 face="sans-serif">&nbsp; gethostname(host_name, sizeof(host_name) );</font>
<br><font size=2 face="sans-serif">&nbsp; ptr=host_name ;</font>
<br><font size=2 face="sans-serif">&nbsp; printf (&quot;Host Name by gethostname() &nbsp; &nbsp;: %s \n&quot;, ptr);</font>
<br><font size=2 face="sans-serif">&nbsp; </font>
<br><font size=2 face="sans-serif">&nbsp; hostptr = gethostbyname(ptr);</font>
<br><font size=2 face="sans-serif">&nbsp; printf (&quot;\nHost Name by gethostbyname() &nbsp;: %s \n&quot;, hostptr-&gt;h_name);</font>
<br>
<br><font size=2 face="sans-serif">&nbsp; for (i = 0; hostptr-&gt;h_aliases[i]; i++)</font>
<br><font size=2 face="sans-serif">&nbsp; printf (&quot;Host Alias by gethostbyname() : %s\n&quot;, hostptr-&gt;h_aliases[i]);</font>
<br><font size=2 face="sans-serif">&nbsp; </font>
<br><font size=2 face="sans-serif">&nbsp; </font>
<br><font size=2 face="sans-serif">&nbsp; ch = strchr(hostptr-&gt;h_name,'.');</font>
<br><font size=2 face="sans-serif">&nbsp; if ( ch == NULL ){</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; printf ( &quot;DNS Entry does nor exist as per the hostname returned by gethostbyname()\n&quot;);</font>
<br><font size=2 face="sans-serif">&nbsp; }</font>
<br><font size=2 face="sans-serif">&nbsp; else{</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; printf ( &quot;Domain by gethostbyname() &nbsp; &nbsp; : %s\n&quot;, ++ch);</font>
<br><font size=2 face="sans-serif">&nbsp; }</font>
<br>
<br><font size=2 face="sans-serif">&nbsp; for (i=0; i&lt;4; i++)</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp;ai[i] = hostptr-&gt;h_addr_list[0][i];</font>
<br>
<br><font size=2 face="sans-serif">&nbsp; for (i=0; i&lt;4; i++)</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp;a[i] = (unsigned char)(ai[i] &amp; 0xFF);</font>
<br><font size=2 face="sans-serif">&nbsp; snprintf(addrbuf, 32, &quot;%d.%d.%d.%d&quot;, a[0], a[1], a[2], a[3]);</font>
<br><font size=2 face="sans-serif">&nbsp; printf (&quot;Host IP by gethostbyname() &nbsp; &nbsp;: %s\n&quot;, addrbuf);</font>
<br>
<br><font size=2 face="sans-serif">&nbsp; hostptr = gethostbyaddr(a,4,AF_INET); </font>
<br><font size=2 face="sans-serif">&nbsp; printf (&quot;\nHost Name by gethostbyaddr() &nbsp;: %s \n&quot;, hostptr-&gt;h_name);</font>
<br><font size=2 face="sans-serif">}</font>
<br>
<br><font size=2 face="sans-serif">=============================================================================================</font>
<br><font size=2 face="sans-serif">cc &nbsp; fqdn_of_host.c &nbsp; -o &nbsp; fqdn_of_host</font>
<br>
<br><font size=2 face="sans-serif">When I run the compiled version of the above source code the output looks like:</font>
<br>
<br><font size=2 face="sans-serif">root@denver $ fqdn_of_host</font>
<br><font size=2 face="sans-serif">Host Name by gethostname() &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;: denver </font>
<br>
<br><font size=2 face="sans-serif">Host Name by gethostbyname() &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;: denver.r2.fs.fed.us </font>
<br><font size=2 face="sans-serif">Domain by gethostbyname() &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; : r2.fs.fed.us</font>
<br><font size=2 face="sans-serif">Host IP by gethostbyname() &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;: 9.99.15.50</font>
<br>
<br><font size=2 face="sans-serif">Host Name by gethostbyaddr() &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;: denver.r2.fs.fed.us </font>
<br>
<br><font size=2 face="sans-serif">root@denver $ </font>
<br>
<br><font size=2 face="sans-serif">===============================================================================================<br>
</font>
<br><font size=2 face="sans-serif">I am of the opinion &nbsp;that &nbsp; &quot; Oracle's argument that &nbsp;FQDN hostname must and should &nbsp;be present on the first line of the /etc/hosts file inorder for the kerberos server/clinet &nbsp;to work correctly &nbsp; does not &nbsp; make a good argument when DNS is configured correctly and it is assured that DNS will work correctly under all circumstances&quot;.</font>
<br>
<br>
<br><font size=2 face="sans-serif"><b><u>What am I requesting you for?</u></b></font>
<br>
<br><font size=2 face="sans-serif">Please confirm to us that &quot; In the environment that has been described in this e-mail, it is NOT necessary for us to put the FQDN name of the host &nbsp;in &nbsp;/etc/hosts file &nbsp;for the kerberos server/client to work correctly &quot;</font>
<br>
<br>
<br><font size=2 face="sans-serif">Once again, thanks for your help. A quick response to this is gratefully acknowledged.</font>
<br>
<br>
<br><font size=2 face="sans-serif">Regards,<br>
<br>
Sridhar<br>
<br>
&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
IBM BCS - &nbsp;Public Sector<br>
Voice &nbsp; &nbsp;(303) 924 - 0413<br>
Email &nbsp; &nbsp;murthys@us.ibm.com<br>
&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;</font>
<br><font size=1 color=#800080 face="sans-serif">----- Forwarded by Sridhar Murthy/Boulder/IBM on 09/11/2003 11:37 PM -----</font>
<br>
<table width=100%>
<tr valign=top>
<td>
<td><font size=1 face="sans-serif"><b>James McBride</b></font>
<p><font size=1 face="sans-serif">09/10/2003 01:47 PM</font>
<br>
<td>
<br><font size=1 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; To: &nbsp; &nbsp; &nbsp; &nbsp;Sridhar Murthy@IBMUS</font>
<br><font size=1 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; cc: &nbsp; &nbsp; &nbsp; &nbsp;Steve Sipocz Jr/Boulder/IBM@IBMUS, wdeschene@fs.fed.us, glongsine@fs.fed.us, Richard A Ernst/Boulder/IBM@IBMUS</font>
<br><font size=1 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; From: &nbsp; &nbsp; &nbsp; &nbsp;James McBride/Boulder/IBM@IBMUS</font>
<br><font size=1 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; Subject: &nbsp; &nbsp; &nbsp; &nbsp;Re: /etc/hosts on a &nbsp;Kerberos client</font><a href=Notes:///8725657000306D26/38D46BF5E8F08834852564B500129B2C/1A0D726442B1B01D87256D9D00669152>Link</a>
<br></table>
<br>
<br><font size=2 face="sans-serif">Srihdar,</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; Can you write C program to verify that &quot;</font><font size=2 face="Courier New">gethostbyaddr(gethostbyname(gethostname())) return a correct hostname with an FQDN</font><font size=2 face="sans-serif">&quot;?<br>
</font>
<br><font size=2 face="sans-serif">TIA </font>
<br><font size=2 face="sans-serif"><br>
Jim McBride<br>
Oracle Deployment and Support<br>
IBM Corporation<br>
6300 Diagonal HWY., Stop 003E<br>
Boulder, CO &nbsp;80301-9020<br>
Office: (303) 924-5626<br>
Lab: (303) 924-0212<br>
Fax: (303) 924-9233<br>
mcbridejt@us.ibm.com<br>
</font>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td>
<td><font size=1 face="sans-serif"><b>Sam Hartman &lt;hartmans@mit.edu&gt;</b></font>
<p><font size=1 face="sans-serif">09/10/2003 12:40 PM</font>
<br>
<td><font size=1 face="Arial">&nbsp; &nbsp; &nbsp; &nbsp; </font>
<br><font size=1 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; To: &nbsp; &nbsp; &nbsp; &nbsp;James McBride/Boulder/IBM@IBMUS</font>
<br><font size=1 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; cc: &nbsp; &nbsp; &nbsp; &nbsp;&lt;krbdev@mit.edu&gt;, wdeschene@fs.fed.us, Sridhar Murthy/Boulder/IBM@IBMUS, Kurt Bevers &lt;Kurt.Bevers@oracle.com&gt;, Steve Sipocz Jr/Boulder/IBM@IBMUS</font>
<br><font size=1 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; Subject: &nbsp; &nbsp; &nbsp; &nbsp;Re: /etc/hosts on a &nbsp;Kerberos client</font>
<br></table>
<br>
<br>
<br><font size=2 face="Courier New">&gt;&gt;&gt;&gt;&gt; &quot;James&quot; == James McBride &lt;mcbridejt@us.ibm.com&gt; writes:<br>
<br>
 &nbsp; &nbsp;James&gt; Dear Kerberos Support Analyst:<br>
<br>
 &nbsp; &nbsp;James&gt; Oracle Support is reporting that MIT Kerberos requires that<br>
 &nbsp; &nbsp;James&gt; the FQDN of a Kerberos client must be in the /etc/hosts<br>
 &nbsp; &nbsp;James&gt; file. &nbsp;They provided the URL below as a reference:<br>
 &nbsp; &nbsp;James&gt; http://web.mit.edu/kerberos/www/krb5-1.3/krb5-1.3.1<br>
 &nbsp; &nbsp;James&gt; /doc/krb5-admin.html#Getting%20DNS%20Information%20Correct<br>
<br>
 &nbsp; &nbsp;James&gt; We feel that Kerberos can use DNS and the operating system<br>
 &nbsp; &nbsp;James&gt; to determine the FQDN of a machine.<br>
<br>
 &nbsp; &nbsp;James&gt; Please provide your perspective on this.<br>
<br>
 &nbsp; &nbsp;James&gt; Thanks In Advance,<br>
<br>
<br>
 &nbsp; &nbsp;James&gt; Jim McBride Oracle Deployment and Support IBM Corporation<br>
 &nbsp; &nbsp;James&gt; 6300 Diagonal HWY., Stop 003E Boulder, CO 80301-9020<br>
 &nbsp; &nbsp;James&gt; Office: (303) 924-5626 Lab: (303) 924-0212 Fax: (303)<br>
 &nbsp; &nbsp;James&gt; 924-9233 mcbridejt@us.ibm.com<br>
<br>
 &nbsp; &nbsp;James&gt; _______________________________________________ krbdev<br>
 &nbsp; &nbsp;James&gt; mailing list krbdev@mit.edu<br>
 &nbsp; &nbsp;James&gt; https://mailman.mit.edu/mailman/listinfo/krbdev<br>
<br>
Hi. &nbsp;The address krbdev@mit.edu is not an appropriate place to request<br>
Kerberos support. &nbsp;This address is for discussion of development of<br>
MIt Kerberos. &nbsp;You may want to address support questions to<br>
kerberos@mit.edu in the future.<br>
<br>
<br>
That said, with regard to DNS and hostnames, the requirement is that<br>
gethostbyaddr(gethostbyname(gethostname())) return a correct hostname<br>
with an FQDN. &nbsp;The easiest way of guaranteeing this is to make sure<br>
that both /etc/hosts and DNS will correctly resolve the machine.<br>
<br>
Things that typically do not work include listing the machine's IP in<br>
/etc/hosts without the FQDN first; listing the machine's name on the<br>
localhost line in /etc/hosts; etc.<br>
<br>
Not listing the machine's name in /etc/hosts at all while correctly<br>
configuring DNS will tend to work correctly.<br>
<br>
<br>
</font>
<br>
<br>
<br>