To peel the onions, fill a large pot halfway with water and bring it to a boil. Fill a large mixing bowl halfway with ice water. Place the whole onions into the boiling water and cook for two minutes. Transfer to ice water to cool. Then cut off the root end of each onion and squeeze gently. Onion will slip fairly easily out of its skin. You can do this up to a few days in advance and store peeled onions in an airtight container in the fridge.
To boil the onions, fill the same pot halfway with fresh water, and salt it generously. Bring to a boil, then add the onions and cook until tender. For 1-inch-diameter onions, this takes about 10-15 minutes.
Meanwhile melt the butter in a medium pot over medium-high heat.
Whisk in the flour and cook for one minute.
Add the milk, salt, and pepper. Bring to a boil, whisking frequently. Then turn down the heat and simmer until thickened, about 5 minutes.
Off the heat, stir in ½ cup of the cheese.
Drain the onions well and place into a baking dish that's safe for broiling.
Pour the sauce overtop and smooth with a spatula, letting it fill any gaps. Sprinkle with remaining cheese.
Broil until browned and bubbly. Sprinkle with minced parsley or chives if you like, and serve.