Hi lads

My passat wont start every now and then. When I put the key in it makes a clunking sound, no lights on the dash. Remove key try again and it works fine. It's happening more frequently now, but each time it has eventually started. Someone told me I need to get key reprogrammed? anyone any ideas?