diff --git a/lib/index.js b/lib/index.js
index <HASH>..<HASH> 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -1,6 +1,7 @@
 var fs = require('fs'),
     Handlebars = require('handlebars'),
     _ = require('lodash'),
+    url = require('url'),
     defaultsDeep = _.partialRight(_.merge, function deep(value, other) {
         return _.merge(value, other, deep);
     }),
@@ -22,6 +23,7 @@ function plugin(options) {
         output: 'sitemap.xml',
         modifiedProperty: 'modified',
         urlProperty: 'path',
+        hostname: '',
         entryTemplate: templatesDir + '/entry.xml',
         sitemapTemplate: templatesDir + '/sitemap.xml',
         defaults: {
@@ -52,7 +54,7 @@ function plugin(options) {
             data.sitemap = data.sitemap || {};
 
             entry = _.defaults({
-                loc: resolve(data, options.urlProperty),
+                loc: url.resolve(options.hostname, resolve(data, options.urlProperty)),
                 lastmod: resolve(data, options.modifiedProperty),
                 changefreq: data.sitemap.changefreq,
                 priority: data.sitemap.priority
Add option for hostname

There was no ability to provide a canonical hostname within the site map.