how to properly edit hosts, hostname and resolf.conf?
I have been searching the Internet for a real nop tutorial on the subject but could not found any direct info. on how to edit these files the proper way.
I have a Debian Internet server that I use to host some personal domains and runs Squid and rTorrent. The server is up and running with no problems. However, I am confused about a few things.
Lets say that I named my server (foo), my domain is (example.com) and my public IP is 95.211.133.200 now:
should /etc/hostname contains:
tango.example.com
or
tango <----- just the server name
should
/etc/hosts
contain:
127.0.0.1 localhost.localdomain localhost
95.211.133.200 foo.example.com foo
should
/etc/resolf.conf
contain (along with the name servers) both:
domain example.com
search example.com
or just the first one.
Are there any other files that I should edit in order to make things right?
last thing, the command:
domainname
returns: (none)
I believe it should return (example.com). What should I do to correct that?
linux hostname hosts
migrated from serverfault.com Apr 2 '12 at 22:23
This question came from our site for system and network administrators.
add a comment |
I have been searching the Internet for a real nop tutorial on the subject but could not found any direct info. on how to edit these files the proper way.
I have a Debian Internet server that I use to host some personal domains and runs Squid and rTorrent. The server is up and running with no problems. However, I am confused about a few things.
Lets say that I named my server (foo), my domain is (example.com) and my public IP is 95.211.133.200 now:
should /etc/hostname contains:
tango.example.com
or
tango <----- just the server name
should
/etc/hosts
contain:
127.0.0.1 localhost.localdomain localhost
95.211.133.200 foo.example.com foo
should
/etc/resolf.conf
contain (along with the name servers) both:
domain example.com
search example.com
or just the first one.
Are there any other files that I should edit in order to make things right?
last thing, the command:
domainname
returns: (none)
I believe it should return (example.com). What should I do to correct that?
linux hostname hosts
migrated from serverfault.com Apr 2 '12 at 22:23
This question came from our site for system and network administrators.
Your shift key appears to be broken.
– Chris S
Apr 2 '12 at 22:21
1
This sounds suspiciously like a homework assignment I once had. Anyway, all of these questions can be answered in man pages:resolv.conf(5)
,hostname(1)
andhosts(5)
– AdmiralNemo
Apr 2 '12 at 23:09
add a comment |
I have been searching the Internet for a real nop tutorial on the subject but could not found any direct info. on how to edit these files the proper way.
I have a Debian Internet server that I use to host some personal domains and runs Squid and rTorrent. The server is up and running with no problems. However, I am confused about a few things.
Lets say that I named my server (foo), my domain is (example.com) and my public IP is 95.211.133.200 now:
should /etc/hostname contains:
tango.example.com
or
tango <----- just the server name
should
/etc/hosts
contain:
127.0.0.1 localhost.localdomain localhost
95.211.133.200 foo.example.com foo
should
/etc/resolf.conf
contain (along with the name servers) both:
domain example.com
search example.com
or just the first one.
Are there any other files that I should edit in order to make things right?
last thing, the command:
domainname
returns: (none)
I believe it should return (example.com). What should I do to correct that?
linux hostname hosts
I have been searching the Internet for a real nop tutorial on the subject but could not found any direct info. on how to edit these files the proper way.
I have a Debian Internet server that I use to host some personal domains and runs Squid and rTorrent. The server is up and running with no problems. However, I am confused about a few things.
Lets say that I named my server (foo), my domain is (example.com) and my public IP is 95.211.133.200 now:
should /etc/hostname contains:
tango.example.com
or
tango <----- just the server name
should
/etc/hosts
contain:
127.0.0.1 localhost.localdomain localhost
95.211.133.200 foo.example.com foo
should
/etc/resolf.conf
contain (along with the name servers) both:
domain example.com
search example.com
or just the first one.
Are there any other files that I should edit in order to make things right?
last thing, the command:
domainname
returns: (none)
I believe it should return (example.com). What should I do to correct that?
linux hostname hosts
linux hostname hosts
edited Oct 8 '12 at 0:50
Linger
2,796102740
2,796102740
asked Apr 2 '12 at 22:16
FirewallFirewall
62
62
migrated from serverfault.com Apr 2 '12 at 22:23
This question came from our site for system and network administrators.
migrated from serverfault.com Apr 2 '12 at 22:23
This question came from our site for system and network administrators.
Your shift key appears to be broken.
– Chris S
Apr 2 '12 at 22:21
1
This sounds suspiciously like a homework assignment I once had. Anyway, all of these questions can be answered in man pages:resolv.conf(5)
,hostname(1)
andhosts(5)
– AdmiralNemo
Apr 2 '12 at 23:09
add a comment |
Your shift key appears to be broken.
– Chris S
Apr 2 '12 at 22:21
1
This sounds suspiciously like a homework assignment I once had. Anyway, all of these questions can be answered in man pages:resolv.conf(5)
,hostname(1)
andhosts(5)
– AdmiralNemo
Apr 2 '12 at 23:09
Your shift key appears to be broken.
– Chris S
Apr 2 '12 at 22:21
Your shift key appears to be broken.
– Chris S
Apr 2 '12 at 22:21
1
1
This sounds suspiciously like a homework assignment I once had. Anyway, all of these questions can be answered in man pages:
resolv.conf(5)
, hostname(1)
and hosts(5)
– AdmiralNemo
Apr 2 '12 at 23:09
This sounds suspiciously like a homework assignment I once had. Anyway, all of these questions can be answered in man pages:
resolv.conf(5)
, hostname(1)
and hosts(5)
– AdmiralNemo
Apr 2 '12 at 23:09
add a comment |
1 Answer
1
active
oldest
votes
/etc/hostname
should have just foo
/etc/hosts
looks fine
/etc/resolv.conf
should probably be example.com
for both, depending on your use case. Note that you named it /etc/resolf.conf
and it should be v
and not f
I don't know about domainname
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
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',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f407827%2fhow-to-properly-edit-hosts-hostname-and-resolf-conf%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
/etc/hostname
should have just foo
/etc/hosts
looks fine
/etc/resolv.conf
should probably be example.com
for both, depending on your use case. Note that you named it /etc/resolf.conf
and it should be v
and not f
I don't know about domainname
add a comment |
/etc/hostname
should have just foo
/etc/hosts
looks fine
/etc/resolv.conf
should probably be example.com
for both, depending on your use case. Note that you named it /etc/resolf.conf
and it should be v
and not f
I don't know about domainname
add a comment |
/etc/hostname
should have just foo
/etc/hosts
looks fine
/etc/resolv.conf
should probably be example.com
for both, depending on your use case. Note that you named it /etc/resolf.conf
and it should be v
and not f
I don't know about domainname
/etc/hostname
should have just foo
/etc/hosts
looks fine
/etc/resolv.conf
should probably be example.com
for both, depending on your use case. Note that you named it /etc/resolf.conf
and it should be v
and not f
I don't know about domainname
answered Oct 8 '12 at 1:34
UtahJarheadUtahJarhead
1,6421915
1,6421915
add a comment |
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f407827%2fhow-to-properly-edit-hosts-hostname-and-resolf-conf%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Your shift key appears to be broken.
– Chris S
Apr 2 '12 at 22:21
1
This sounds suspiciously like a homework assignment I once had. Anyway, all of these questions can be answered in man pages:
resolv.conf(5)
,hostname(1)
andhosts(5)
– AdmiralNemo
Apr 2 '12 at 23:09