Forums » Software Development »
How to register hostname with DNS?
Added by Mary Frantz about 12 years ago
I would like to use DHCP for ip address assignment, set my own hostname and register it with DNS.
So, far I can get an IP address just fine. I see that the hostname is in /etc/hostname (currently set to mityomapl138). Presumably I can change that to whatever I need. How do you register the hostname with DNS? The mitydsp can find other nodes by name using nslookup, but the other nodes can't find mityomapl138 by name.
I changed /etc/resolv.conf to:
root@mityomapl138:~# cat /etc/resolv.conf nameserver 192.168.1.254
On my windows PC (hostname: mdf_l2):
C:\>nslookup mityomapl138 Server: dslrouter Address: 192.168.1.254 *** dslrouter can't find mityomapl138: Non-existent domain
On my Linux Virtual Machine (Ubuntu) (hostname: mitydsp-dev):
mitydsp@mitydsp-dev:~$ nslookup mityomapl138 Server: 192.168.1.254 Address: 192.168.1.254#53 ** server can't find mityomapl138: NXDOMAIN
On the mitydsp:
root@mityomapl138:~# nslookup mitydsp-dev Server: 192.168.1.254 Address 1: 192.168.1.254 dslrouter Name: mitydsp-dev Address 1: 192.168.1.87 mitydsp-dev root@mityomapl138:~# nslookup mdf_l2 Server: 192.168.1.254 Address 1: 192.168.1.254 dslrouter Name: mdf_l2 Address 1: 192.168.1.88 mdf_l2
U-Boot bootargs are as follows:
bootargs=mem=64M console=ttyS1,115200n8 mtdparts=nand:128M(rootfs),-(userfs) roo t=/dev/mtdblock0 rw,noatime rootfstype=jffs2 ip=dhcp
During Boot:
PHY: 0:03 - Link is Up - 100/Full Sending DHCP requests ., OK IP-Config: Got DHCP answer from 192.168.1.254, my address is 192.168.1.86 IP-Config: Complete: device=eth0, addr=192.168.1.86, mask=255.255.255.0, gw=192.168.1.254, host=192.168.1.86, domain=launchmodem.com, nis-domain=(none), bootserver=192.168.1.254, rootserver=192.168.1.254, rootpath=
Thanks for any help. My colleague suggests using Samba. Any thoughts?
Replies (4)
RE: How to register hostname with DNS? - Added by Jonathan Cormier about 12 years ago
This might be what your looking for.
http://www.linuxquestions.org/questions/linux-networking-3/dns-registration-on-internal-network-284556/
RE: How to register hostname with DNS? - Added by Mary Frantz about 12 years ago
The answer there was:
Just to follow up with this, I finally got it working. I had to make a change in /etc/hosts and /etc/sysconfig/network-scripts/ifcfg-eth0. The files are below if anyone is interested. Thanks for the help! /etc/hosts: # Do not remove the following line, or various programs # that require network functionality will fail. 127.0.0.1 linuxhost1.localdomain linuxhost1 /etc/sysconfig/network-scripts/ifcfg-eth0: DEVICE=eth0 BOOTPROTO=dhcp ONBOOT=yes TYPE=Ethernet DHCP_HOSTNAME=linuxhost1 USERCTL=no PEERDNS=yes
He is using RedHat. This distro does not have a file /etc/sysconfig/network-scripts/ifcfg-eth0
There is no directory sysconfig under /etc.
Sounds like you have to send the hostname as a parameter when invoking DHCP. Just don't know how.
RE: How to register hostname with DNS? - Added by Jonathan Cormier about 12 years ago
http://www.turnkeylinux.org/forum/support/20090212/register-hostname-dns
This post suggests setting hostname in /etc/network/interfaces file.
RE: How to register hostname with DNS? - Added by Mary Frantz about 12 years ago
I modified /etc/network/interfaces as described:
# Wired or wireless interfaces auto eth0 iface eth0 inet dhcp hostname mityomapl138 iface eth1 inet dhcp
Still nslookup cannot find mityomapl138, and I can't ping by name either (only ip address).
The post also recommended removing udhcp and installing dhcp3-client using apt-get, then installing samba. apt-get doesn't work, of course, but I tried finding these with opkg.
root@mityomapl138:/etc/network# opkg list | grep dhcp busybox-udhcpc - 1.19.4-r6 - Tiny versions of many common UNIX utilities in a si ngle small executable. busybox-udhcpd - 1.19.4-r6 - Tiny versions of many common UNIX utilities in a si ngle small executable. dhcp-client - 4.2.3-P2-r1 - Internet Software Consortium DHCP package dhcp-dbg - 4.2.3-P2-r1 - Internet Software Consortium DHCP package - Debugging f iles dhcp-dev - 4.2.3-P2-r1 - Internet Software Consortium DHCP package - Development files dhcp-doc - 4.2.3-P2-r1 - Internet Software Consortium DHCP package - Documentati on files dhcp-omshell - 4.2.3-P2-r1 - Internet Software Consortium DHCP package dhcp-relay - 4.2.3-P2-r1 - Internet Software Consortium DHCP package dhcp-relay-systemd - 4.2.3-P2-r1 - Internet Software Consortium DHCP package dhcp-server - 4.2.3-P2-r1 - Internet Software Consortium DHCP package dhcp-server-config - 4.2.3-P2-r1 - Internet Software Consortium DHCP package dhcp-server-systemd - 4.2.3-P2-r1 - Internet Software Consortium DHCP package dhcp-staticdev - 4.2.3-P2-r1 - Internet Software Consortium DHCP package - Devel opment files (Static Libraries)
dhcp3-client doesn't seem to be on the list. Couldn't find samba either.
root@mityomapl138:/etc/network# opkg list | grep samba root@mityomapl138:/etc/network#
Does that mean there is no samba package that's compatible with this distro? Is DNS compatiblity with a Windows PC host possible? I may have to resort to hard coded ip addresses.
Mary