title: Keytool set hostname
body: <p>I am just attempting to use the java keytool but I cannot figure out how to set the hostname.  </p>
  
  <p>This is what is how I am attempting:</p>
  
  <pre><code>hostname[username:/this/is/a/path][640]% keytool -keystore server.keystore -genkeypair -alias hostname
  Enter keystore password:
  Re-enter new password:
  What is your first and last name?
    [Unknown]:  hostname
  What is the name of your organizational unit?
    [Unknown]:  hostname
  What is the name of your organization?
    [Unknown]:  hostname
  What is the name of your City or Locality?
    [Unknown]:  hostname
  What is the name of your State or Province?
    [Unknown]:  hostname
  What is the two-letter country code for this unit?
    [Unknown]:  CA
  Is CN=hostname, OU=hostname, O=hostname, L=hostname, ST=hostname, C=CA correct?
    [no]:  yes
  
  Enter key password for &lt;hostname&gt;
          (RETURN if same as keystore password):
  hostname[username:/this/is/a/path][641]%
  </code></pre>
  
  <p>Since I have set all fields to hostname can I assume that my hostname is set to hostname?</p>