System.Domain empty

View: New views
8 Messages — Rating Filter:   Alert me  

System.Domain empty

by Ron Klinkien :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


System.Domain is empty (none) on my system (Debian 4.0) gambas 2.6

hostname -f is giving correct fqdn

Where should it be defined?

Regards,
Ron.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Gambas-user mailing list
Gambas-user@...
https://lists.sourceforge.net/lists/listinfo/gambas-user

Re: System.Domain empty

by Stefano Palmeri :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Il Thursday 15 May 2008 14:57:21 Ron ha scritto:

> System.Domain is empty (none) on my system (Debian 4.0) gambas 2.6
>
> hostname -f is giving correct fqdn
>
> Where should it be defined?
>
> Regards,
> Ron.
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Gambas-user mailing list
> Gambas-user@...
> https://lists.sourceforge.net/lists/listinfo/gambas-user

try system.host

ciao,

Stefano

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Gambas-user mailing list
Gambas-user@...
https://lists.sourceforge.net/lists/listinfo/gambas-user

Re: System.Domain empty

by Ron Klinkien :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Stefano Palmeri schreef:

> Il Thursday 15 May 2008 14:57:21 Ron ha scritto:
>  
>> System.Domain is empty (none) on my system (Debian 4.0) gambas 2.6
>>
>> hostname -f is giving correct fqdn
>>
>> Where should it be defined?
>>
>> Regards,
>> Ron.
>>
>> -------------------------------------------------------------------------
>> This SF.net email is sponsored by: Microsoft
>> Defy all challenges. Microsoft(R) Visual Studio 2008.
>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>> _______________________________________________
>> Gambas-user mailing list
>> Gambas-user@...
>> https://lists.sourceforge.net/lists/listinfo/gambas-user
>>    
>
> try system.host
>
> ciao,
>
> Stefano
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Gambas-user mailing list
> Gambas-user@...
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>  
That one only returns the host / machine name, not the domain.

Regards,

Ron.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Gambas-user mailing list
Gambas-user@...
https://lists.sourceforge.net/lists/listinfo/gambas-user

Re: System.Domain empty

by Benoit Minisini :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On jeudi 15 mai 2008, Ron wrote:
> System.Domain is empty (none) on my system (Debian 4.0) gambas 2.6
>
> hostname -f is giving correct fqdn
>
> Where should it be defined?
>
> Regards,
> Ron.
>

The Linux man page are not very clear...

Apparently, you have:
- A system host name.
- A system domain name, or DNS domain name.
- A NIS/YP domain name.

hostname -f returns the third, but System.Domain uses the getdomainname()
system call that seems to return the second.

Try "man hostname" to get more information.

Regards,

--
Benoit Minisini

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Gambas-user mailing list
Gambas-user@...
https://lists.sourceforge.net/lists/listinfo/gambas-user

Re: System.Domain empty

by Ron Klinkien :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Benoit Minisini schreef:

> On jeudi 15 mai 2008, Ron wrote:
>  
>> System.Domain is empty (none) on my system (Debian 4.0) gambas 2.6
>>
>> hostname -f is giving correct fqdn
>>
>> Where should it be defined?
>>
>> Regards,
>> Ron.
>>
>>    
>
> The Linux man page are not very clear...
>
> Apparently, you have:
> - A system host name.
> - A system domain name, or DNS domain name.
> - A NIS/YP domain name.
>
> hostname -f returns the third, but System.Domain uses the getdomainname()
> system call that seems to return the second.
>
> Try "man hostname" to get more information.
>
> Regards,
>
>  

This is what I see.. so it looks like gambas is reading the NIS domain
instead of the correct one (-d).
Since (none) is what I see in gambas. Maybe hostname arguments are not
the same on linux distros?
-------------------------------------------------
ron@server:~$ hostname -h
Usage: hostname [-v] {hostname|-F file}      set host name (from file)
       domainname [-v] {nisdomain|-F file}   set NIS domain name (from file)
       hostname [-v] [-d|-f|-s|-a|-i|-y]     display formated name
       hostname [-v]                         display host name

       hostname -V|--version|-h|--help       print info and exit

    dnsdomainname=hostname -d, {yp,nis,}domainname=hostname -y

    -s, --short           short host name
    -a, --alias           alias names
    -i, --ip-address      addresses for the host name
    -f, --fqdn, --long    long host name (FQDN)
    -d, --domain          DNS domain name
    -y, --yp, --nis       NIS/YP domain name
    -F, --file            read host name or NIS domain name from given file

   This command can get or set the host name or the NIS domain name. You can
   also get the DNS domain or the FQDN (fully qualified domain name).
   Unless you are using bind or NIS for host lookups you can change the
   FQDN (Fully Qualified Domain Name) and the DNS domain name (which is
   part of the FQDN) in the /etc/hosts file.
--------------------------------------------

server:~$ hostname -d
cyberjunky.nl

server:~$ hostname -y
(none)

server:~$ hostname -f
machine.cyberjunky.nl

Gambas 2.6 on Debian 4.0

Regards,
Ron

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Gambas-user mailing list
Gambas-user@...
https://lists.sourceforge.net/lists/listinfo/gambas-user

Re: System.Domain empty

by Benoit Minisini :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On vendredi 16 mai 2008, Ron wrote:

> Benoit Minisini schreef:
> > On jeudi 15 mai 2008, Ron wrote:
> >> System.Domain is empty (none) on my system (Debian 4.0) gambas 2.6
> >>
> >> hostname -f is giving correct fqdn
> >>
> >> Where should it be defined?
> >>
> >> Regards,
> >> Ron.
> >
> > The Linux man page are not very clear...
> >
> > Apparently, you have:
> > - A system host name.
> > - A system domain name, or DNS domain name.
> > - A NIS/YP domain name.
> >
> > hostname -f returns the third, but System.Domain uses the getdomainname()
> > system call that seems to return the second.
> >
> > Try "man hostname" to get more information.
> >
> > Regards,
>
> This is what I see.. so it looks like gambas is reading the NIS domain
> instead of the correct one (-d).

There is no "correct one". Gambas just uses the getdomainname() function that
uses the uname() system call, and this system call returns what it returns.

But you are right: I traced the "hostname" program with strace. When asking
for the host name or the NIS/YP domain name, it uses the uname() system call.

So if you want to get the FQDN, you have to run "hostname -f" by hand.
Apparently there is no function in the C library to get this information, as
it requires some heavy process.

Regards,

--
Benoit Minisini

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Gambas-user mailing list
Gambas-user@...
https://lists.sourceforge.net/lists/listinfo/gambas-user

Re: System.Domain empty

by Rob Kudla :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Friday 16 May 2008 05:12, Benoit Minisini wrote:
> So if you want to get the FQDN, you have to run "hostname -f" by
> hand. Apparently there is no function in the C library to get this
> information, as it requires some heavy process.

On my laptop, "hostname" and "hostname -f" print the same value, which
does not include my domain, and even if it had given me the domain,
the hostname plus the domain would not have resolved to anything
because it's my router that has a hostname on the Internet, not my
laptop.  

So, I don't know if even that's a reliable enough way of getting the
FQDN.  If you're connected directly to the net, you could get the
machine's IP address and do a reverse DNS lookup.  If not, maybe one
of the "what is my IP" web sites has a web service you could use to
get the "outside" IP and/or FQDN, assuming you're not behind a proxy
as well.  

But I don't think it's something you can reliably get from the machine
on which the program is running, because most machines aren't
directly connected to the Internet anymore.

Rob

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Gambas-user mailing list
Gambas-user@...
https://lists.sourceforge.net/lists/listinfo/gambas-user

Re: System.Domain empty

by Ron Klinkien :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Benoit Minisini schreef:

> On jeudi 15 mai 2008, Ron wrote:
>  
>> System.Domain is empty (none) on my system (Debian 4.0) gambas 2.6
>>
>> hostname -f is giving correct fqdn
>>
>> Where should it be defined?
>>
>> Regards,
>> Ron.
>>
>>    
>
> The Linux man page are not very clear...
>
> Apparently, you have:
> - A system host name.
> - A system domain name, or DNS domain name.
> - A NIS/YP domain name.
>
> hostname -f returns the third, but System.Domain uses the getdomainname()
> system call that seems to return the second.
>
> Try "man hostname" to get more information.
>
> Regards,
>
>  
For reference, I finally have this fixed by this:

server:~# sysctl kernel.domainname
kernel.domainname = (none)

Set it correctly:

server:~# sysctl kernel.domainname=mydomain.com
kernel.domainname = mydomain.com

Put it also in /etc/sysctl.conf.

System.Domain is ok now.

regards,
Ron.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Gambas-user mailing list
Gambas-user@...
https://lists.sourceforge.net/lists/listinfo/gambas-user
LightInTheBox - Buy quality products at wholesale price