You not be able use CoreDNS from outside kubernetes. You should expose the pod via Ingress or LoadBalancer or NodePort Type service and configure an external DNS provider to resolve a hostname to the IP as Arghya Sadhu answers.
Other approach use external IP to your services and communicate with your Public IP directly.
Here some example :
- External IP
apiVersion: v1
kind: Service
metadata:
name: postgres
labels:
app: postgres
spec:
type: ClusterIP
ports:
- port: 5432
targetPort: 5432
selector:
app: postgres
externalIPs:
- <YOUR_PUBLIC_IP_ADDRESS>
- NodePort
apiVersion: v1
kind: Service
metadata:
name: postgres
labels:
app: postgres
spec:
type: NodePort
ports:
- port: 5432
targetPort: 5432
selector:
app: postgres