OpenShift - List DNS objects using the oc get dns command

by
Jeremy Canfield |
Updated: October 09 2022
| OpenShift articles
If you are not familiar with the oc command, refer to OpenShift - Getting Started with the oc command.
The oc get dns command can be used to list the DNS objects. By default, OpenShift should have a single DNS object named "cluster".
~]$ oc get dns
NAME AGE
cluster 422d
The oc describe dns command can be used to display more details, including the Base Domain name.
~]$ oc describe dns cluster
Name: cluster
Namespace:
Labels: <none>
Annotations: <none>
API Version: config.openshift.io/v1
Kind: DNS
Metadata:
Creation Timestamp: 2021-07-16T17:10:10Z
Generation: 1
Managed Fields:
API Version: config.openshift.io/v1
Fields Type: FieldsV1
fieldsV1:
f:spec:
.:
f:baseDomain:
f:status:
Manager: cluster-bootstrap
Operation: Update
Time: 2021-07-16T17:10:10Z
Resource Version: 545
UID: 8d2d9acf-2248-4b94-a241-0c824ec4edbd
Spec:
Base Domain: openshift.example.com
Status:
Events: <none>
Or, the oc get dns command with the --output json or --output yaml option can be used.
~]$ oc get dns cluster --output yaml
apiVersion: config.openshift.io/v1
kind: DNS
metadata:
creationTimestamp: "2021-07-16T17:10:10Z"
generation: 1
name: cluster
resourceVersion: "545"
uid: 8d2d9acf-2248-4b94-a241-0c824ec4edbd
spec:
baseDomain: openshift.example.com
status: {}
Did you find this article helpful?
If so, consider buying me a coffee over at