How do I get the domain name
While $GLOBALS['base_url'] will give you the domain, it really isn't a good idea to use it directly.  URLs should either use url() or file_create_url().  For example,

$path = drupal_get_path('theme', 'MYTHME');

drupal_add_html_head(array(
  '#tag' =&gt; 'link',
  '#attributes' =&gt; array(
    'href' =&gt; file_create_url($path . '/images/touch-icon-iphone.png'),
    'rel' =&gt; 'apple-touch-icon',
  ),
), 'MYTHME-touch-icon-iphone');


will add the iPhone icon meta to the &lt;head&gt; from the images/ directory from a theme.  Leveraging the API will allow paths to be altered, which is necessary for module like CDN to do their thing.