Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Missing Network Name
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
meruchan
n00b
n00b


Joined: 02 May 2003
Posts: 2

PostPosted: Fri May 02, 2003 9:33 pm    Post subject: Missing Network Name Reply with quote

Somewhere along the way I seem to have misplaced my network name. Upon finishing booting, I am greeted with "This is lucia.(none) (Linux i686 2.4.20-gaming-r3)"

The hostname file contains "lucia.pentagulia.net" and nothing else.

I've compared it to other machines on my network and can find no obvious place the network name should be but isn't.

Anyone know what I am missing?

Thank you!
Back to top
View user's profile Send private message
compu-tom
Guru
Guru


Joined: 09 Jan 2003
Posts: 415
Location: Berlin, Germany

PostPosted: Fri May 02, 2003 9:38 pm    Post subject: Reply with quote

This seems to be the name of the hosts at the time of making the kernel. Rebuilt your kernel if you want the current host name to be shown.
Back to top
View user's profile Send private message
dbasinge
Tux's lil' helper
Tux's lil' helper


Joined: 04 Jul 2002
Posts: 86
Location: Salt Lake City, UT

PostPosted: Fri May 02, 2003 9:42 pm    Post subject: Reply with quote

I have the same problem, it does not seem to affect anything. My machine is running a Samba print server just fine. The only problem is is my domain name is listed as .(none) :)

I'm also using gaming-sources kernel.

Mike
_________________
D. Michael Basinger, RHCE
If at first you don't succeed, skydiving is not for you. - Anonymous
Back to top
View user's profile Send private message
compu-tom
Guru
Guru


Joined: 09 Jan 2003
Posts: 415
Location: Berlin, Germany

PostPosted: Fri May 02, 2003 9:45 pm    Post subject: Reply with quote

And you both have a /etc/hostname containing a FQHN?
Back to top
View user's profile Send private message
dbasinge
Tux's lil' helper
Tux's lil' helper


Joined: 04 Jul 2002
Posts: 86
Location: Salt Lake City, UT

PostPosted: Fri May 02, 2003 9:50 pm    Post subject: Reply with quote

compu-tom wrote:
And you both have a /etc/hostname containing a FQHN?


My /etc/hostname has
Code:

grev.speakeasy.net


My /etc/hosts has
Code:

127.0.0.1       localhost
192.168.1.101   grev.speakeasy.net      grev


I never had a problem seeing my domain name till I re-install Gentoo this week.

Mike
_________________
D. Michael Basinger, RHCE
If at first you don't succeed, skydiving is not for you. - Anonymous
Back to top
View user's profile Send private message
compu-tom
Guru
Guru


Joined: 09 Jan 2003
Posts: 415
Location: Berlin, Germany

PostPosted: Fri May 02, 2003 9:53 pm    Post subject: Reply with quote

Maybe this is an issue of the gaming-sources!?!

Is the hostname only incorrect when the kernel boots or is it even later when the system's up and running?
Back to top
View user's profile Send private message
dbasinge
Tux's lil' helper
Tux's lil' helper


Joined: 04 Jul 2002
Posts: 86
Location: Salt Lake City, UT

PostPosted: Fri May 02, 2003 10:04 pm    Post subject: Reply with quote

hostname always shows
grev

domainname always shows
(none)

I have report this to bug.gentoo.org
https://bugs.gentoo.org/show_bug.cgi?id=20352
_________________
D. Michael Basinger, RHCE
If at first you don't succeed, skydiving is not for you. - Anonymous
Back to top
View user's profile Send private message
compu-tom
Guru
Guru


Joined: 09 Jan 2003
Posts: 415
Location: Berlin, Germany

PostPosted: Fri May 02, 2003 10:08 pm    Post subject: Reply with quote

Try
Code:
domainname <yourdomain>
See the man page of domainname.
Back to top
View user's profile Send private message
dbasinge
Tux's lil' helper
Tux's lil' helper


Joined: 04 Jul 2002
Posts: 86
Location: Salt Lake City, UT

PostPosted: Fri May 02, 2003 10:18 pm    Post subject: Reply with quote

domainname will set my domain, but it is losted when I reboot.

Mike
_________________
D. Michael Basinger, RHCE
If at first you don't succeed, skydiving is not for you. - Anonymous
Back to top
View user's profile Send private message
compu-tom
Guru
Guru


Joined: 09 Jan 2003
Posts: 415
Location: Berlin, Germany

PostPosted: Fri May 02, 2003 10:21 pm    Post subject: Reply with quote

Note that domainname is only responsible for the NIS/YP-domainname. If you do not run NIS/YP, don't care about what domainname says. All that normally counts is the output of hostname (or hostname -f).
Back to top
View user's profile Send private message
dbasinge
Tux's lil' helper
Tux's lil' helper


Joined: 04 Jul 2002
Posts: 86
Location: Salt Lake City, UT

PostPosted: Fri May 02, 2003 10:24 pm    Post subject: Reply with quote

hostname -f does show
grev.speakeasy.net

So it is probably just a display bug during boot, and has no real effect on the system.

Mike
_________________
D. Michael Basinger, RHCE
If at first you don't succeed, skydiving is not for you. - Anonymous
Back to top
View user's profile Send private message
Genone
Retired Dev
Retired Dev


Joined: 14 Mar 2003
Posts: 9535
Location: beyond the rim

PostPosted: Sun May 04, 2003 12:47 pm    Post subject: Reply with quote

I have a small program lying around here that sets the domainname based on your FQDN, so you could add it to /etc/conf.d/local.start and never worry about your domainname. Just copy+paste the code below and compile it with "gcc -o setdomainname setdomainname.c"

Code:

/* 
 * setdomainname.c
 *
 * Copyright (C) 2003 Marius Mauch <genone@genone.de>
 *
 * This program sets the proper domainname for the current
 * hostname set by the 'hostname' command.
 *
 * Usage: setdomainname [-p] [-h] [-v]
 * 
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version
 * 2 of the License, or (at your option) any later version.
 */

#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>

#define PROGRAM   "setdomainname"
#define VERSION   "0.1"
#define AUTHOR    "Marius Mauch <genone@genone.de>"

#define OPTIONS   "phv"


/* set a maximum length for the hostname,  */
#ifdef HOST_NAME_MAX         
   /* defined by POSIX */
   #define HOSTNAME_LENGTH HOST_NAME_MAX
#elif defined(MAXHOSTNAMELEN)      
   /* implemented in current Unix-versions */
   #define HOSTNAME_LENGTH MAXHOSTNAMELEN
#else
   #define HOSTNAME_LENGTH 500
#endif

/*
 * prints the standard error message for the current errno-value and exits
 */
void stderror(void)
{
   perror(NULL);
   exit(1);
}

/*
 * prints a short help message
 */
void show_help(void)
{
   puts("Usage: " PROGRAM " [-p] [-h] [-v]");
   puts("where\t -p   don't do anything, but show the domainname that would be set");
   puts("\t -h   print this help message");
   puts("\t -v   print version information");
}

/*
 * dumps out the version information
 */
void show_version(void)
{
   puts(PROGRAM " " VERSION);
   puts("Copyright 2003 " AUTHOR);
}

int main(int argc, char **argv)
{
   char *host = NULL;
   char *domain = NULL;
   int c = -1;
   int displaymode = 0;
   
   while ((c = getopt(argc, argv, OPTIONS)) != -1) {
      switch (c) {
         case 'p':
            displaymode = 1;
            break;
         case 'h':
         case '?':
            show_help();
            return 0;
         case 'v':
            show_version();
            return 0;
         default:
            break;
      }
   }
   
   host = (char *)malloc(HOSTNAME_LENGTH * sizeof(char));
   if (!host)
      stderror();
   
   if (gethostname(host, HOSTNAME_LENGTH))
      stderror();
   
   /* get the substring after the first . */
   domain = strchr(host, '.');
   if (domain == NULL) {
      fprintf(stderr, "Invalid hostname: %s\n", strlen(host) ? host : "(empty)");
      return 1;
   }
   domain++;   

   if (displaymode) {
      printf("The domainname would be: %s\n", strlen(domain) ? domain : "(empty)");
   } else {
      if (setdomainname(domain, strlen(domain)))
         stderror();
   }
   
   free(host);
   return 0;
}
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum