Fill a large pot with lightly salted water and bring to a rolling boil over high heat. Once the water is boiling, stir in the pasta and return to the boil. Cook the pasta uncovered, stirring occasionally, until cooked through, but is still firm to the bite, about 5 minutes. Drain well in a colander set in the sink.
Preheat oven to 180 C / Gas 4. Butter a 20x30cm baking dish.
Beat the eggs, milk, sugar and vanilla extract together in a bowl. Stir in the pasta. Pour the mixture in the prepared baking dish. Pour the melted butter over the pasta, then top with the coconut.
Bake in the preheated oven until the pasta is set and the coconut is golden brown, about 1 hour.