Preheat your oven to 350°F (175°C).
In a small saucepan, heat the coconut milk until warm.
In a separate mixing bowl, beat the eggs, sugar, vanilla, and salt together until well combined.
Slowly pour the warm coconut milk into the egg mixture while whisking constantly.
Add in the whole milk and continue whisking until fully incorporated.
Stir in the shredded coconut.
Gently pour the custard mixture into the flan mold or cake pan.
Place the flan mold or cake pan in a large roasting pan and fill the roasting pan with enough hot water to reach halfway up the sides of the mold.
Carefully place the roasting pan in the preheated oven and bake for 40-45 minutes, or until the center of the flan is just set.
Remove the flan from the water bath and let it cool to room temperature.
Once cooled, place the flan in the refrigerator for at least 2 hours, or overnight.
To serve, run a sharp knife around the edges of the flan and invert onto a serving dish.
Top with whipped cream and toasted coconut flakes, if desired.
Enjoy your delicious coconut flan!