(There may be a way of doing this from the main menu but this is the way I have always done it)....
Start a game and press E to bring up the inventory / NEI. Click on Options and then Block / Item ID Settings. You will see options in there to Dump BlockIDs, Dump Unused BlockIDs, Dump ID Map...