Is it possible to get a list of ports related to services so that I can use the services instead of ports to open up?
The services and ports are in the file /etc/services (or /usr/etc/services).
Thanks, found it in /etc/services
firewall-cmd --service=*service *--get-ports
If you are asking, is it possible to query which service includes given port - I do not think it is possible via command. You would need to parse service definitions directly or list all services and then for each service list ports and check whether your port matches.