Hi!
Pain at the back of the head could be a case of occipital neuralgia. This usually happens due to spinal nerve compression because of upper cervical spinal nerves caused by overuse of computers, work involving straining of neck, herniated disc, canal stenosis, bone disease, spondylosis, poor posture. You should have a MRI focusing only on C1-3 and also look at C1-2 instability (may be the cause of your symptoms). These can be treated with occipital nerve blocks, physiotherapy, medications etc. Do discuss this with your doctor and get yourself examined. Take care!
The medical advice given should not be considered a substitute for medical care provided by a doctor who can examine you. The advice may not be completely correct for you as the doctor cannot examine you and does not know your complete medical history. Hence this reply to your post should only be considered as a guiding line and you must consult your doctor at the earliest for your medical problem.