|
-
Help in C!
I am trying to write a C program to write the following information. Does
anyone know what files I need to search to find the answers to the following
questions?
Steve
what is my host name?
who is my DNS server?
who is my NIS server?
I am NIS server.
I am DNS server.
what order I resolve host names?
what is my domain name?
who I mount NFS from?
do I mount AFS?
what file system I am sharing and whom I am sharing it to?
what is my IP address(es)?
am I a web server?
am I a route? if yes what do I route?
what UNIX system am I running?
who is (are) my DNS server(s)?
who is (are) my NIS server(s)?
I am NIS+ server.
who is my NIS+ master server.
where do I check user names and passwords from?
where do I check network services?
-
Re: Help in C!
Hmmm...Best thing for you to do is get this book - Publishers is Wrox Press,
Ttitle Linux Programming 2nd Edition, it will contain the answers to most
of your questions....personally you could get away with it using a shell
script which would be made much easier unless you want to write an administrator
program to do all of this.....
"steve" <SteveCusick@bigfoot.com> wrote:
>
>I am trying to write a C program to write the following information. Does
>anyone know what files I need to search to find the answers to the following
>questions?
>
>Steve
>
>what is my host name?
>who is my DNS server?
>who is my NIS server?
>I am NIS server.
>I am DNS server.
>what order I resolve host names?
>what is my domain name?
>who I mount NFS from?
>do I mount AFS?
>what file system I am sharing and whom I am sharing it to?
>what is my IP address(es)?
>am I a web server?
>am I a route? if yes what do I route?
>what UNIX system am I running?
snip>>>>
try uname -a
>who is (are) my DNS server(s)?
>who is (are) my NIS server(s)?
>I am NIS+ server.
>who is my NIS+ master server.
>where do I check user names and passwords from?
snip>>>
There is a function to read from the passwd file and will tell you what
shell etc....cannot remember the function, the passwords/users etc are located
in /etc/passwd. Beware that the passwd file itself could be shadowed ie.
you will not see the passwd and need root privileges to look into it!!!
>where do I check network services?
snip>>>>
look in /etc/services...some distros have their own front end ...eg suse
6.3 (which I have) comes with yast which will allow you to glance at what
your ip address is etc.....
>
-
Re: Help in C!
I agree that a shell script would do this easier, but there are system functions
you can call to do this as well. If you want to read files though i've put
what i know below.
"Tom Brennan" <tommieb@dds.nl> wrote:
>
>Hmmm...Best thing for you to do is get this book - Publishers is Wrox Press,
>Ttitle Linux Programming 2nd Edition, it will contain the answers to most
>of your questions....personally you could get away with it using a shell
>script which would be made much easier unless you want to write an administrator
>program to do all of this.....
>"steve" <SteveCusick@bigfoot.com> wrote:
>>
>>I am trying to write a C program to write the following information. Does
>>anyone know what files I need to search to find the answers to the following
>>questions?
>>
>>Steve
>>
>>what is my host name?
hostname or hostname.something
>>who is my DNS server?
resolv.conf
>>who is my NIS server?
>>I am NIS server.
>>I am DNS server.
>>what order I resolve host names?
nsswitch.conf
>>what is my domain name?
resolv.conf
>>who I mount NFS from?
mnttab or fstab (I forget which one on Linux)
>>do I mount AFS?
>>what file system I am sharing and whom I am sharing it to?
smb.conf (?)
>>what is my IP address(es)?
ifconfig [interface name] is the command
>>am I a web server?
look for apache.conf and httpd processes
>>am I a route? if yes what do I route?
>>what UNIX system am I running?
>snip>>>>
> try uname -a
>>who is (are) my DNS server(s)?
resolv.conf
>>who is (are) my NIS server(s)?
>>I am NIS+ server.
>>who is my NIS+ master server.
>>where do I check user names and passwords from?
>snip>>>
> There is a function to read from the passwd file and will tell you what
>shell etc....cannot remember the function, the passwords/users etc are located
>in /etc/passwd. Beware that the passwd file itself could be shadowed ie.
>you will not see the passwd and need root privileges to look into it!!!
>
>>where do I check network services?
>snip>>>>
> look in /etc/services...some distros have their own front end ...eg suse
>6.3 (which I have) comes with yast which will allow you to glance at what
>your ip address is etc.....
>>
>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks