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 SITE.pagekite.me, 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 domain.com and have a PageKite Service account named you.pagekite.me, and you want www.domain.com to be served over PageKite.

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

  1. Create domain.you.pagekite.me using this form
  2. Create a CNAME record for www.domain.com linking it to domain.you.pagekite.me
  3. Add www.domain.com 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.

Explanations

Step 1. is technically not required, you could also create a CNAME directly on you.pagekite.me. 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 domain.com and receive e-mail on that domain, then you can not create a CNAME for the top level domain.com name.

This is due to technical details of how DNS and e-mail interact. Generally you can create a CNAME for any other name (www.domain.com or pagekite.domain.com or my.page.domain.com 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 pagekite.py 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 pagekite.py 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:

service_on=http:domain.you.pagekite.me:localhost:80:SECRET
service_on=http:www.domain.com:localhost:80:SECRET

(Older versions of pagekite.py 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 domain.you.pagekite.me are kept up to date as your front-ends change, and the second takes care of actually registering and routing traffic for www.domain.com.

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 domain.you.pagekite.me. 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.

Comments

  1. adolfo said on 2012-04-13, 18:40
    cool
    Permalink
  2. Mozart said on 2012-07-20, 15:36
    Where exactly do I need to put these lines?
    backend=http:domain.you.pagekite.me:localhost:80:SECRET
    backend=http:www.domain.com:localhost:80:SECRET

    Permalink
  3. Bjarni Rúnar Einarsson said on 2012-07-20, 15:41
    Please see https://pagekite.net/support/quicksta... for details on configuring pagekite.py.
    Permalink
  4. Mozart said on 2012-07-20, 20:20
    Thanks for your swift reply.
    I successfully ran
    pagekite.py --add 80 http:my.name.pagekite.me
    pagekite.py --add 443 https:my.name.pagekite.me

    But
    pagekite.py --add 80 http:my.domain.com
    pagekite.py --add 443 https:my.domain.com
    gives errors:
    .. !!! REJECTED: http:www.my.domain.com (Invalid account or shared secret)
    and does not creat a kite

    my.domain.com is listed as CNAME under my.name.pagekite.me in my account overview.

    Could you help me out again?
    Permalink
  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!
    Permalink
  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 pagekite.py 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?

    Thanks
    Permalink
  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.
    Permalink
  8. Marty Ballard said on 2012-11-29, 03:11
    For step 2 above, if you went with hover.com, you'll need to add a new DNS with the following format:
    Hostname: www
    Record Type: CNAME
    Target Host: sitename.accountid.pagekite.me

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

    what did i do wrong?
    Permalink
  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:

    http://www.namecheap.com/?aff=46594

    HOW-TO CNAME @ NAME-CHEAP

    1: lets assume you bought " yourdomain.com " @ 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): www.yourdomain.com
    4b. choose (Record Type): URL-Redirect
    4c. choose (TTL): 1800

    (This takes care for the redirection of (yourdomain.com) to (www.yourdomain.com)

    5. second line: look at Hostname (www)

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

    Thats it! --- you are all set and BOTH domains (yourdomain.com AND www.yourdomain.com) are pointing to

    your-name.pagekite.me

    Hope that helps,

    thanks for reading,

    Hans
    please do NOT forget to enter your CNAME url into the settings script ...
    Permalink
  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 freenom.com
    PLEASE HELP!
    Permalink
  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.
    Permalink
  13. joy said on 2018-06-25, 22:33
    This was really helpful
    Permalink
  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...
    Permalink
  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.
    Permalink
  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.
    Permalink
  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: help@pagekite.net)? Is it free or paid? I want to use it for my business.
    Permalink
  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!
    Permalink
  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?
    Permalink
  20. deadinside said on 2022-07-05, 03:12
    Ok, I figured it out for CloudFlare users.

    1. DELETE ALL ENTRIES.
    2. Add a CNAME entry with 'sitename.xyz' in the 'Name' area and 'www.sitename.xyz' in 'Content'
    2. Add a CNAME entry with 'www' in the 'Name' area and 'sitename.pagekite.me' 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
    Permalink
  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
    Permalink
  22. Olivier Steiner said on 2024-02-21, 11:29
    hello, I have the same problem as Sean Miller, is it possible to have https://www.mydomain.com rather than http://www.mydomain.com
    Permalink
  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.
    Permalink

Leave a comment

( (Please leave these blank: )

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