What would be the protocol if a medieval town or castle came under attack by a dragon? Did any medieval writers theorize about the best way to defeat them if they actually existed?

by hborrgg
sunagainstgold

Medieval bestiaries include dracones per standard (there is a bit of confusion because "draco" can either mean dragon or snake; it is called the greatest serpent), although they assign them to living somewhere in the east--generally India, which is the go-to classical=>medieval term for "the exotic east." The medieval conception of these dragons was that they were big enough to wrap around an elephant and suffocate it.

Manuscripts of medieval travel literature (like Marco Polo or John Mandeville), even when the authors don't describe encountering dragons or large serpents, frequently garnered dragons as illustration. Here's one from a 15C copy of Marco Polo. Now, was this the illuminator's way of signaling "exotic lands with exotic beasts," or what they believed to be an accurate representation of what the author was describing (or not describing, but was certainly there)? How did readers take it?

There are also plenty of hagiographic accounts of dracones, sometimes as demons--St. George, St. Margaret of Antioch, a legend of Sts. Simon and Jude in Babylon. This is perhaps where we can turn to find medieval ideas of dragons versus people, since OP asked about dragon attacks. These dragons, primarily, attack by eating people. This was an influential line of dragon understanding--some of the later medieval bestiaries add in that the devil is a dragon or dragons come from the devil, which is definitely not in Pliny the Elder. :P

I can't imagine that lords and castellans ever seriously worried that dragons might attack their castle. It's possible that some believed demons in the form of dragons might, and perhaps eat a saint or two (Margaret kills the dragon that eats her by bursting out of its stomach), but the solution to that would be prayer and repentance. Frankly, there were much more pressing threats to worry about.