Char the onion halves and ginger cut-side down in a dry skillet over high heat (or under the broiler) until blackened in spots, 5-7 minutes. Rinse off loose charred bits.
Toast the star anise, cinnamon, cloves, and coriander seeds in the dry skillet over medium heat until fragrant, about 2 minutes. Bundle in cheesecloth or a tea infuser.
Place the chicken in a large stockpot with the water. Bring to a boil, skimming foam for the first 10-15 minutes.
Add the charred onion and ginger, spice bundle, salt, and rock sugar. Simmer gently 35-40 minutes until the chicken is tender.
Lift out the chicken; when cool enough to handle, shred or thinly slice the meat. Discard skin and bones.
Remove the spice bundle. Stir in fish sauce, starting with 3 tablespoons; taste and adjust seasoning.
Cook the rice noodles in a separate pot of boiling water until just tender. Drain and rinse briefly.
Divide noodles among warm bowls. Top with sliced onion, scallion whites, and chicken. Ladle hot broth over, then finish with scallion greens, herbs, bean sprouts, and lime.