the fast, reliable localhost tunneling solution

Using CNAMEs with PageKite

By Bjarni R. Einarsson 2021-04-15, 23:07

Not everybody wants a website with a name like, many already own their own domain names and would rather use those.

In fact, this is recommended - it provides a layer of abstraction and independence between your identity on-line and the PageKite Service. If you use a CNAME, you will more easily be able to move your website to some other solution or provider at a later date, if you so choose.

Obviously we hope you won't ever feel the need to do so, but having the freedom to choose is important.

How it's done

Let's assume you own and have a PageKite Service account named, and you want to be served over PageKite.

The recommended CNAME-based configuration would involve the following steps:

  1. Create using this form
  2. Create a CNAME record for linking it to
  3. Add to your PageKite account using this form. Be sure to use the CNAME option at the bottom of the box.
  4. Follow the instructions below to add the required back-ends to your PageKite configuration file.


Step 1. is technically not required, you could also create a CNAME directly on However, by using a separate name, you preserve the ability to later use the two names for different websites on different computers.

How exactly to go about step 2. varies depending on where you bought your domain name. We hope to provide more details on the following, if you can help please feel free to edit these pages or upload screenshots:

Steps 3. and 4 are required to integrate the new name into your PageKite configuration.

Limitations of CNAMEs

Note that if you own and receive e-mail on that domain, then you can not create a CNAME for the top level name.

This is due to technical details of how DNS and e-mail interact. Generally you can create a CNAME for any other name ( or or to name a few), just not for the top level name itself.

Configuring Your PageKite Install

Once the DNS records have been created and your PageKite account brought up to date, you need to reconfigure your PageKite configuration file - which may be called or something like 80_http.rc depending on your installation - to know about your domain. If you have the second form of install the config files should live in the directory /etc/pagekite.d. Using whereis pagekite from the command line should reveal which form of install you have pretty quickly - if you don't have but you do have /etc/pagekite.d, you have the second kind.

This usually requires adding two lines to your configuration file, which would look like this:

(Older versions of used backend= instead. SECRET is your PageKite secret - you can use "@kitesecret" if you've loaded the variable or you can put the actual string of your secret.)

Both lines are needed, as the first will guarantee that the DNS records for are kept up to date as your front-ends change, and the second takes care of actually registering and routing traffic for

Note: some Linux builds which include PageKite, e.g. the FreedomBox version of Debian, may add the first line for you when you turn on http access using the configuration utility (in FB Debian, it's called Plinth.) So if you see a line that looks similar to it in the file already, do not add it again. It may use the variable @kitename instead of You still need to add the second line.

Also note that if you want to expose HTTPS or SSH servers you will need to add lines for those as well in the appropriate config file(s). If you have a Debian install, including a FreedomBox, it should be fairly apparent which files you need to modify as their names consist of the port number the service uses plus the name of the service. The syntax is consistent.


  1. adolfo said on 2012-04-13, 18:40
  2. Mozart said on 2012-07-20, 15:36
    Where exactly do I need to put these lines?

  3. Bjarni Rúnar Einarsson said on 2012-07-20, 15:41
    Please see for details on configuring
  4. Mozart said on 2012-07-20, 20:20
    Thanks for your swift reply.
    I successfully ran --add 80 --add 443

    But --add 80 --add 443
    gives errors:
    .. !!! REJECTED: (Invalid account or shared secret)
    and does not creat a kite is listed as CNAME under in my account overview.

    Could you help me out again?
  5. Bjarni Rúnar Einarsson said on 2012-07-21, 22:57
    Actually, the main point of the link I sent was it describes where you can find your configuration file (.pagekite.rc or pagekite.cfg depending on your operating system). I think it's still necessary to edit it by hand for CNAME records, although I hope to correct that in a future release of the software. Sorry I wasn't more clear!
  6. Chad said on 2012-08-14, 17:49
    hey guys... after I attempt to edit this file on my Windows 2008 R2 server, I try to relaunch and it doesn't start up.

    Where in the config file do I add these lines?

    Are they tab delimited, or can I just copy/paste the code above and modify with my own info?

  7. Bjarni Rúnar Einarsson said on 2012-08-14, 19:45
    Spaces or tabs, either or both should be fine. Copy-paste probably works, but take care not to have duplicate definitions. Note that the --backend syntax has been replaced by --service_on in PageKite 0.5 - the old syntax still works (they are completely equivalent), but this can be a source of confusion as you may not realize that you have duplicate lines.
  8. Marty Ballard said on 2012-11-29, 03:11
    For step 2 above, if you went with, you'll need to add a new DNS with the following format:
    Hostname: www
    Record Type: CNAME
    Target Host:

  9. Nils said on 2013-01-30, 15:22
    i own the domain and want to point it to domain. Following point 2 in the instructions above i entered the line "www IN CNAME" into the zonefile for Unfortuntly a "host" now answers is an alias for has address

    what did i do wrong?
  10. name-cheap - CNAME (Alias) worked ! said on 2013-03-01, 18:22
    Hi all,

    great thing you put together - just what I was looking for - since 5 (!) days ... so YOU need better marketing (joke) - or I need better search-engine-handling ...

    However - I just bought a domain at NAME-CHEAP - and here is my aff-link - in case you wanna help me become rich:


    1: lets assume you bought " " @ name-cheap.

    2: log in and click on that domain name

    3. scroll down a bit, left side is " Host-Managment", click on "All Hosts Records"

    4. first line: look at Hostname (@)

    4a. enter (IP-Address/URL):
    4b. choose (Record Type): URL-Redirect
    4c. choose (TTL): 1800

    (This takes care for the redirection of ( to (

    5. second line: look at Hostname (www)

    5a. enter (IP-Address/URL):
    5b. choose (Record Type): CNAME (Alias)
    5c. choose (TTL): 1800

    Thats it! --- you are all set and BOTH domains ( AND are pointing to

    Hope that helps,

    thanks for reading,

    please do NOT forget to enter your CNAME url into the settings script ...
  11. Steve said on 2015-04-09, 04:52
    OMG, what I get for a week is only ".tk not a service domain"
    when I try to add my domain to pagekite.
    hosting website is
  12. Femi said on 2016-01-22, 13:38
    I cant seem to redirect the domain in 1and1 control panel. It keeps saying this url is invalid.
  13. joy said on 2018-06-25, 22:33
    This was really helpful
  14. bjørn said on 2021-04-26, 22:55
    the restriction about dashes when adding a cname record is very annoying.
    it basically stops me from using non English characters like ÆØÅ in my domain name.
    domains that would be typed like this "xn--giben-xua" (gibøen) is basically not allowed...
    this restriction should have been clearly stated somewhere or just removed...
  15. Bjarni Rúnar Einarsson said on 2021-04-27, 10:41
    That's a really good point, Bjørn! I do not remember why that restriction is in place, but it sounds like the kind of thing I might be able to easily change. Thank you for bringing this to my attention.
  16. Savir said on 2021-05-03, 16:31
    I love using PageKite, thanks so much for creating it, I don't know how it's not extremely popular - it took me months to find out about it. Nevertheless, it's the most amazing thing ever, it helps me so much.
  17. Savir said on 2021-05-03, 17:46
    By the way, Bjarni, I had a business-related question. What do you use for business emails (example: Is it free or paid? I want to use it for my business.
  18. Weirdo said on 2021-05-04, 21:45
    How do I have more than 5 connections for my PageKite website? I don't want it to stop working after 5 people use the site!
  19. Sean Miller said on 2021-06-04, 00:59
    I am trying to set up an Apache server running .Net Core 5 under a GoDaddy domain. It works fine when I have the GoDaddy just forward, but I would like to have the domain "mask" my pagekite domain instead.

    When I do that, it masks correctly, but always flips to http instead of https. Anyone know why that would be?
  20. deadinside said on 2022-07-05, 03:12
    Ok, I figured it out for CloudFlare users.

    2. Add a CNAME entry with '' in the 'Name' area and '' in 'Content'
    2. Add a CNAME entry with 'www' in the 'Name' area and '' in 'Content' DO NOT SAVE YET.
    3. Set 'Proxy status' to 'DNS only' and set 'TTL' to '30 min'. Now you can save.
    4. Enter your site into the CNAME field on pagekite now.

    This worked for me atleast
  21. Kofi Adeku said on 2023-11-12, 14:13
    Hello I have a ubuntu localhost server and need to configure it from pagekit and at the same time I have a domain which I want to use please help
  22. Olivier Steiner said on 2024-02-21, 11:29
    hello, I have the same problem as Sean Miller, is it possible to have rather than
  23. Jaypee said on 2024-02-26, 04:03
    Have the same problem with Sean Miller and Olivier Steiner. http is loading byt https is not.

    GoDaddy has Forwarding with Mask, it works as it loads the kite properly in http. However, when you change the URL to https this error appears "ERR_CONNECTION_REFUSED".

    Having a hard time following instructions here. Hopefully there will be someone to resolve this clearly.

Leave a comment

( (Please leave these blank: )

We use Gravatar for commenter's photos. Get your own, it's free!