I am wondering why NS record is needed in the DNS zone file. Client gets the NS record with IP (GLUE record) from the TLD and then proceed further with name resolution. So where do we do we need NS record from zone file in name resolution process. Even if this information is not available in zone file then still name resolution will happen smoothly.
The TLDs don't hold resource records for all second level domains, they query their zone information for authoritative records that indicate what servers have the domain information which is being queried.
This TLD query looks for SOA and the NS records associated for the indicated FQDN. If the TLD cannot find an authoritative servers (NS Records) the root DNS servers will not know where to direct the DNS query to.
Also understand that there is caching of DNS records involved in the operation of DNS servers. DNS Servers typically cache query responses to enhance response times to frequently requested domains. Since caching is involved, DNS records have an associated TTL (Time To Live) information on every record, indicating how long a record should be hold in a local cache before the caching server should try to refresh the records.
**DNS clients (non-servers) also cache information about DNS names it has previously resolved.
Meaning that there is a time delay (depending on the domain configuration) is DNS record updates replicating around the global DNS infrastructure.
It would then be possible for you to delete your NS records and for a short time, DNS resolution could continue uninterrupted.
So, to summarize, NS records are required in a DNS Domains to tell querying clients (other servers or clients) what servers at what IP Addresses are authoritative for the domain being queried. Without knowing which IP Address to communicate with (from the SOA and NS records), DNS queries would not function.