Are military records public record?

In some cases, for example ancestory.com is pretty public. Im not sure about other websites.