Not to be confused with a DNS resolver, the other component of the Domain name system (DNS). (However, note that the same host may perform both jobs.)
The job of a DNS nameserver is to be the authoritative source of any DNS resource record (RR) that falls within its DNS zone. Note, however, that this information may not actually reside on the nameserver: if it has delegated the value to a subordinate zone, then the nameserver will need to act as a resolver in order to respond to a lookup request.
At the top of this hierarchy is the DNS root server, which is responsible for the null suffix. Its immediate children are the nameservers for the zones corresponding to each of the Top-level domain (TLD)s.
By default, DNS resolvers assume that DNS nameservers are trustworthy. This is a bad assumption. DNSsec attempts to address this, though it has its limitations.