DNS Lab use of ping or nslookup

hi

In DNS Lab

https://kodekloud.com/courses/873064/lectures/17074530

Q.
What is the IP address of the site www.facebook.com ? Use ping to test

Of course as question expects the answer is found out by using ping alone.

Output

bob@caleston-lp10:~$ ping www.facebook.com
PING star-mini.c10r.facebook.com (185.60.216.35): 56 data bytes
64 bytes from 185.60.216.35: icmp_seq=0 ttl=55 time=5.161 ms64 bytes from 185.60.216.35: icmp_seq=1 ttl=55 time=5.344 ms
64 bytes from 185.60.216.35: icmp_seq=2 ttl=55 time=5.393 ms
64 bytes from 185.60.216.35: icmp_seq=3 ttl=55 time=5.292 ms
64 bytes from 185.60.216.35: icmp_seq=4 ttl=55 time=5.315 ms
^Cā€” star-mini.c10r.facebook.com ping statistics ā€”
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max/stddev = 5.161/5.301/5.393/0.078 ms
bob@caleston-lp10:~$bob@caleston-lp10:~$
bob@caleston-lp10:~$ nslookup facebook.comServer: 127.0.0.11
Address: 127.0.0.11#53

Non-authoritative answer:
Name: facebook.com
Address: 185.60.216.35
Name: facebook.com
Address: 2a03:2880:f12d:83:face:b00c:0:25de

bob@caleston-lp10:~$
bob@caleston-lp10:~$
bob@caleston-lp10:~$

Hint : run: nslookup facebook.com

If questions ask to use ping and it gives same results as nslookup why do we need to mention hint for using nslookup and not ping www.facebook.com

Am I missing anything here in this question or rational of this question ?

You can use either for the first question. ping or nslookup, but there is a follow up question which you may have noticed that the IP changes because of the hosts file based dns resolution.
In this case you will have to use ping as nslookup or dig will still make use of the dns server.