How to access ubuntu server using just hostname and not hostaname.local

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
0
down vote

favorite












I have a ubuntu-Server 16.04 LTS running and fully updated. I can access it through IP Address and hostname.local, but if I try to access it with just hostname it can't reach the address.
hostname and host files are properly configure.



Details about My hosts:



  • ubuntu-server 16.04 (lets call it ubuntuserver for better
    undestanding);

  • ubuntu 17.10 (called ubuntudesktop);

  • windows (called firstwin);

  • windows (called secondwin).

Note that I can ping ubuntudesktop with just the hostname with any Operating System










share|improve this question























  • How do you trying to get access to server? by ssh? Does the server responding on pings when you trying to ping it by hostname?
    – Dexter Morganov
    Feb 15 at 8:29










  • Not just SSH, I use this server for media, database and backup. I have two machines with windows and one ubuntu. With ubuntu I can Access it using hostname.local and IP. On windows only IP works
    – alculete
    Feb 15 at 14:07














up vote
0
down vote

favorite












I have a ubuntu-Server 16.04 LTS running and fully updated. I can access it through IP Address and hostname.local, but if I try to access it with just hostname it can't reach the address.
hostname and host files are properly configure.



Details about My hosts:



  • ubuntu-server 16.04 (lets call it ubuntuserver for better
    undestanding);

  • ubuntu 17.10 (called ubuntudesktop);

  • windows (called firstwin);

  • windows (called secondwin).

Note that I can ping ubuntudesktop with just the hostname with any Operating System










share|improve this question























  • How do you trying to get access to server? by ssh? Does the server responding on pings when you trying to ping it by hostname?
    – Dexter Morganov
    Feb 15 at 8:29










  • Not just SSH, I use this server for media, database and backup. I have two machines with windows and one ubuntu. With ubuntu I can Access it using hostname.local and IP. On windows only IP works
    – alculete
    Feb 15 at 14:07












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I have a ubuntu-Server 16.04 LTS running and fully updated. I can access it through IP Address and hostname.local, but if I try to access it with just hostname it can't reach the address.
hostname and host files are properly configure.



Details about My hosts:



  • ubuntu-server 16.04 (lets call it ubuntuserver for better
    undestanding);

  • ubuntu 17.10 (called ubuntudesktop);

  • windows (called firstwin);

  • windows (called secondwin).

Note that I can ping ubuntudesktop with just the hostname with any Operating System










share|improve this question















I have a ubuntu-Server 16.04 LTS running and fully updated. I can access it through IP Address and hostname.local, but if I try to access it with just hostname it can't reach the address.
hostname and host files are properly configure.



Details about My hosts:



  • ubuntu-server 16.04 (lets call it ubuntuserver for better
    undestanding);

  • ubuntu 17.10 (called ubuntudesktop);

  • windows (called firstwin);

  • windows (called secondwin).

Note that I can ping ubuntudesktop with just the hostname with any Operating System







16.04 server hostname






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 15 at 13:56

























asked Feb 15 at 8:09









alculete

44113




44113











  • How do you trying to get access to server? by ssh? Does the server responding on pings when you trying to ping it by hostname?
    – Dexter Morganov
    Feb 15 at 8:29










  • Not just SSH, I use this server for media, database and backup. I have two machines with windows and one ubuntu. With ubuntu I can Access it using hostname.local and IP. On windows only IP works
    – alculete
    Feb 15 at 14:07
















  • How do you trying to get access to server? by ssh? Does the server responding on pings when you trying to ping it by hostname?
    – Dexter Morganov
    Feb 15 at 8:29










  • Not just SSH, I use this server for media, database and backup. I have two machines with windows and one ubuntu. With ubuntu I can Access it using hostname.local and IP. On windows only IP works
    – alculete
    Feb 15 at 14:07















How do you trying to get access to server? by ssh? Does the server responding on pings when you trying to ping it by hostname?
– Dexter Morganov
Feb 15 at 8:29




How do you trying to get access to server? by ssh? Does the server responding on pings when you trying to ping it by hostname?
– Dexter Morganov
Feb 15 at 8:29












Not just SSH, I use this server for media, database and backup. I have two machines with windows and one ubuntu. With ubuntu I can Access it using hostname.local and IP. On windows only IP works
– alculete
Feb 15 at 14:07




Not just SSH, I use this server for media, database and backup. I have two machines with windows and one ubuntu. With ubuntu I can Access it using hostname.local and IP. On windows only IP works
– alculete
Feb 15 at 14:07










2 Answers
2






active

oldest

votes

















up vote
0
down vote













You have configured hostname and hosts on your server only. In this case only server knows it's hostname.



For access to this server by it's hostname your should have properly configured DNS records or records in hosts file on your computer (for correct resolving hostname to IP address).






share|improve this answer




















  • I have an application running on this server as well accessed by smartphone, windows and a ubuntu machine. This doesn't seems to be the right approach. As I said before I can access it with hostname.local and not just hostname
    – alculete
    Feb 20 at 13:27

















up vote
0
down vote













If you want the hostname and hostname.local to be resolved, and you use linux to access hostname, you have to add



search local


in your /etc/resolv.conf file. I am not sure how you do that if resolv.conf is generated. However, take a look at http://man7.org/linux/man-pages/man5/resolv.conf.5.html, where you can see directives for resolv.conf file.



You should always add your domain(s) with search if you want that also short names would be resolved correctly. If you computer is also in the same domain you can also use domain keyword. Since your top domain is local you do not have to change ndots option.



Probably the simplest way to make this work is to name your computer from where you try to access hostname to be yourcomputer.local. In that way, local will automatically be considered as your domain and both (hostname and hostname.local) will be resolved.



You did not give enough detail, what OS are you using to access hostname and how do you want to access it.






share|improve this answer






















  • I've added more information on the problem I hope helps
    – alculete
    Feb 15 at 13:58










  • I use both Linux and Windows to access
    – alculete
    Feb 19 at 9:26










Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "89"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1006383%2fhow-to-access-ubuntu-server-using-just-hostname-and-not-hostaname-local%23new-answer', 'question_page');

);

Post as a guest






























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
0
down vote













You have configured hostname and hosts on your server only. In this case only server knows it's hostname.



For access to this server by it's hostname your should have properly configured DNS records or records in hosts file on your computer (for correct resolving hostname to IP address).






share|improve this answer




















  • I have an application running on this server as well accessed by smartphone, windows and a ubuntu machine. This doesn't seems to be the right approach. As I said before I can access it with hostname.local and not just hostname
    – alculete
    Feb 20 at 13:27














up vote
0
down vote













You have configured hostname and hosts on your server only. In this case only server knows it's hostname.



For access to this server by it's hostname your should have properly configured DNS records or records in hosts file on your computer (for correct resolving hostname to IP address).






share|improve this answer




















  • I have an application running on this server as well accessed by smartphone, windows and a ubuntu machine. This doesn't seems to be the right approach. As I said before I can access it with hostname.local and not just hostname
    – alculete
    Feb 20 at 13:27












up vote
0
down vote










up vote
0
down vote









You have configured hostname and hosts on your server only. In this case only server knows it's hostname.



For access to this server by it's hostname your should have properly configured DNS records or records in hosts file on your computer (for correct resolving hostname to IP address).






share|improve this answer












You have configured hostname and hosts on your server only. In this case only server knows it's hostname.



For access to this server by it's hostname your should have properly configured DNS records or records in hosts file on your computer (for correct resolving hostname to IP address).







share|improve this answer












share|improve this answer



share|improve this answer










answered Feb 15 at 8:55









Dexter Morganov

42228




42228











  • I have an application running on this server as well accessed by smartphone, windows and a ubuntu machine. This doesn't seems to be the right approach. As I said before I can access it with hostname.local and not just hostname
    – alculete
    Feb 20 at 13:27
















  • I have an application running on this server as well accessed by smartphone, windows and a ubuntu machine. This doesn't seems to be the right approach. As I said before I can access it with hostname.local and not just hostname
    – alculete
    Feb 20 at 13:27















I have an application running on this server as well accessed by smartphone, windows and a ubuntu machine. This doesn't seems to be the right approach. As I said before I can access it with hostname.local and not just hostname
– alculete
Feb 20 at 13:27




I have an application running on this server as well accessed by smartphone, windows and a ubuntu machine. This doesn't seems to be the right approach. As I said before I can access it with hostname.local and not just hostname
– alculete
Feb 20 at 13:27












up vote
0
down vote













If you want the hostname and hostname.local to be resolved, and you use linux to access hostname, you have to add



search local


in your /etc/resolv.conf file. I am not sure how you do that if resolv.conf is generated. However, take a look at http://man7.org/linux/man-pages/man5/resolv.conf.5.html, where you can see directives for resolv.conf file.



You should always add your domain(s) with search if you want that also short names would be resolved correctly. If you computer is also in the same domain you can also use domain keyword. Since your top domain is local you do not have to change ndots option.



Probably the simplest way to make this work is to name your computer from where you try to access hostname to be yourcomputer.local. In that way, local will automatically be considered as your domain and both (hostname and hostname.local) will be resolved.



You did not give enough detail, what OS are you using to access hostname and how do you want to access it.






share|improve this answer






















  • I've added more information on the problem I hope helps
    – alculete
    Feb 15 at 13:58










  • I use both Linux and Windows to access
    – alculete
    Feb 19 at 9:26














up vote
0
down vote













If you want the hostname and hostname.local to be resolved, and you use linux to access hostname, you have to add



search local


in your /etc/resolv.conf file. I am not sure how you do that if resolv.conf is generated. However, take a look at http://man7.org/linux/man-pages/man5/resolv.conf.5.html, where you can see directives for resolv.conf file.



You should always add your domain(s) with search if you want that also short names would be resolved correctly. If you computer is also in the same domain you can also use domain keyword. Since your top domain is local you do not have to change ndots option.



Probably the simplest way to make this work is to name your computer from where you try to access hostname to be yourcomputer.local. In that way, local will automatically be considered as your domain and both (hostname and hostname.local) will be resolved.



You did not give enough detail, what OS are you using to access hostname and how do you want to access it.






share|improve this answer






















  • I've added more information on the problem I hope helps
    – alculete
    Feb 15 at 13:58










  • I use both Linux and Windows to access
    – alculete
    Feb 19 at 9:26












up vote
0
down vote










up vote
0
down vote









If you want the hostname and hostname.local to be resolved, and you use linux to access hostname, you have to add



search local


in your /etc/resolv.conf file. I am not sure how you do that if resolv.conf is generated. However, take a look at http://man7.org/linux/man-pages/man5/resolv.conf.5.html, where you can see directives for resolv.conf file.



You should always add your domain(s) with search if you want that also short names would be resolved correctly. If you computer is also in the same domain you can also use domain keyword. Since your top domain is local you do not have to change ndots option.



Probably the simplest way to make this work is to name your computer from where you try to access hostname to be yourcomputer.local. In that way, local will automatically be considered as your domain and both (hostname and hostname.local) will be resolved.



You did not give enough detail, what OS are you using to access hostname and how do you want to access it.






share|improve this answer














If you want the hostname and hostname.local to be resolved, and you use linux to access hostname, you have to add



search local


in your /etc/resolv.conf file. I am not sure how you do that if resolv.conf is generated. However, take a look at http://man7.org/linux/man-pages/man5/resolv.conf.5.html, where you can see directives for resolv.conf file.



You should always add your domain(s) with search if you want that also short names would be resolved correctly. If you computer is also in the same domain you can also use domain keyword. Since your top domain is local you do not have to change ndots option.



Probably the simplest way to make this work is to name your computer from where you try to access hostname to be yourcomputer.local. In that way, local will automatically be considered as your domain and both (hostname and hostname.local) will be resolved.



You did not give enough detail, what OS are you using to access hostname and how do you want to access it.







share|improve this answer














share|improve this answer



share|improve this answer








edited Feb 15 at 10:42

























answered Feb 15 at 8:55









nobody

3,084912




3,084912











  • I've added more information on the problem I hope helps
    – alculete
    Feb 15 at 13:58










  • I use both Linux and Windows to access
    – alculete
    Feb 19 at 9:26
















  • I've added more information on the problem I hope helps
    – alculete
    Feb 15 at 13:58










  • I use both Linux and Windows to access
    – alculete
    Feb 19 at 9:26















I've added more information on the problem I hope helps
– alculete
Feb 15 at 13:58




I've added more information on the problem I hope helps
– alculete
Feb 15 at 13:58












I use both Linux and Windows to access
– alculete
Feb 19 at 9:26




I use both Linux and Windows to access
– alculete
Feb 19 at 9:26

















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1006383%2fhow-to-access-ubuntu-server-using-just-hostname-and-not-hostaname-local%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

How do so many people here on Academia.SE, and in general, afford lavish higher education programs?

Trouble downloading packages list due to a “Hash sum mismatch” error

How do I move numbers in filenames, in a batch renaming operation?