# The connection to the server 6443 was refused - did you specify the right host or port?

**URL:** <https://discuss.kubernetes.io/t/the-connection-to-the-server-6443-was-refused-did-you-specify-the-right-host-or-port/21859>\
**Category:** General Discussions\
**Tags:** kubernetes-custom-resources\
**Created:** [November 7, 2022, 6:55am UTC](https://discuss.kubernetes.io/t/the-connection-to-the-server-6443-was-refused-did-you-specify-the-right-host-or-port/21859 "2022-11-07T06:55:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arvind-admin](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/arvind-admin/32/11122_2.png) [@Arvind-admin](https://discuss.kubernetes.io/u/Arvind-admin)\
**Post date:** [November 7, 2022, 6:55am UTC](https://discuss.kubernetes.io/t/the-connection-to-the-server-6443-was-refused-did-you-specify-the-right-host-or-port/21859/1 "2022-11-07T06:55:51Z")

</div>

ubuntu@ip-172-31-35-118:~$ kubectl version  
WARNING: This version information is deprecated and will be replaced with the output from kubectl version --short. Use --output=yaml|json to get the full version.  
Client Version: version.Info{Major:“1”, Minor:“25”, GitVersion:“v1.25.3”, GitCommit:“434bfd82814af038ad94d62ebe59b133fcb50506”, GitTreeState:“clean”, BuildDate:“2022-10-12T10:57:26Z”, GoVersion:“go1.19.2”, Compiler:“gc”, Platform:“linux/amd64”}  
Kustomize Version: v4.5.7  
The connection to the server 172.31.35.118:6443 was refused - did you specify the right host or port?

Since even then i swapoff -a and followed below steps:

sudo -i  
swapoff -a  
exit  
strace -eopenat kubectl versionit
