Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Register DNS 1

Status
Not open for further replies.

NetworkGhost

IS-IT--Management
Apr 12, 2005
1,324
US
Does linux machines not register themselves in DNS or attempt to on start up with a static IP? Is there a command to do so?
 
An example would be helpful.. are you comparing this to WINS? Are you using a dynamic IP resolution service like "dyndns.org"? Are you expecting the box to magically insert itself into DNS?



D.E.R. Management - IT Project Management Consulting
 
Ok, Well compared to Windows where I can force the client machine to update through active directory regardless of dynamic or static IP.

What I am looking for is a way to do this to a linux box. I know of NSUpdate but the you have to enter the client IP address in. I was wondering if there was a command to register in DNS the ip address of the network adapter like ipconfig /registerdns in windows
 
You could make an "updatedns" script using nsupdate, and get the IP address like so:

/sbin/ifconfig eth0 | grep 'inet addr' | awk '{print $2}' | sed -e s/.*://

 
There are possibilities to take a static or dynamic IP on startup, a bit differing from distro to distro, and with greater differences, depending on the installation and the environment, depending on your internet-connection.

You will not run a DNS, until you have a big network.
Sounds more, like you're asking for dhcp.

To check, if you have an ip, use ifconfig as mentioned by lgarner.

To check your initscripts, look for /etc/rc.d/inet*.d

What kind of internetconnection do you have? Permanent via Router, modem, ...



seeking a job as java-programmer in Berlin:
 
Not really looking for DHCP. What I am wanting is for a way to make new Linux machines register themselves in my internal DNS. I am a Windows guy so I am not to familiar with Linux. In Windows there are several ways to make a machine register with DNS and not have to use DHCP. The main reason I am doing this is so when my engineers set up a new Linux server I dont have to keep adding in DNS entries so they can access by name on my windows network. A script would be fine. Im not quite sure how to create one for Linux. I am just now starting to learn how a Linux domain works.

Lgarner: If its not to much could you tell me how to go about doing this? Like what file extension and how the script would go? Id appreciate it. Thanks
 
A script might be something like this:

#!/bin/sh
ADDR=`/sbin/ifconfig eth0 | grep 'inet addr' | awk '{print $2}' | sed -e s/.*://`
HOST=`hostname -f`
echo "update delete $HOST A" > /var/nsupdate.txt
echo "update add $HOST 86400 A $ADDR" >> /var/nsupdate.txt
nsupdate /var/nsupdate.txt


I haven't used nsupdate myself, so try 'man nsupdate' to see if you can get it to do what you want.

An easier way might be to create a subdomain and delegate it to the engineers, then let them manage their own DNS.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top