Preheat the oven to 350 degrees F (175 degrees C).
Melt butter in a medium saucepan over medium heat. Sauté onion for 2 minutes. Stir in flour and cook for 1 minute, stirring constantly.
Then stir in milk, salt, mustard, and pepper. Cook, stirring frequently, until mixture boils and thickens.
Meanwhile, bring a pot of lightly salted water to a boil. Add macaroni and cook until al dente, 8 to 10 minutes; drain.
Add Cheddar and American cheeses to milk mixture; stir until cheese melts.
Combine cheese sauce and macaroni in a 2-quart baking dish; mix well.
Bake in preheated oven until hot and bubbly, about 30 minutes. Let cool 10 minutes before serving.
