Preheat oven to 350 degrees F
Melt butter in a medium sausepan over medium heat. Saute onion for 2 minutes. Stir in flour and cook 1 minute, stirring constantly. Stir in milk, salt, mustard and pepper; cook , stirring frequently, until mixture boils and thickened.
Meanwhile, bring a pot of lightly salted water to a boil. Add macaroni and cook for 8 to 10 minutes; drain
To the milk mixture add the Cheddar cheese; stir until cheese melts. Combine macaroni and cheese sauce in a 2 quart baking dish; mix well.
Bake in preheated for 30 minutes. Leave to cool for 10 minutes before serving