Solved

Linux Static IP register in Domain DNS

Posted on 2013-06-04
8
630 Views
Last Modified: 2013-06-05
I am completely new to Linux and therefore I hope this is a simple query for those of you who know what they are doing.

Firstly the background.  I have create a Virtual Server on Windows 2008 R2 on which I have installed Linux Mint 14.  I have given it a fixed IP and opened up our firewall to allow internet access to this IP address.  This all works fine and I have installed Apache, mySQL and PHP sucessfully.

My problem is with my network DNS.  At present I can access my new linux box by IP, but it hasn't registered itself with our DNS server.  Therefore when trying to access by name from another computer on our LAN it cannot find it.

I have set the network connection to use our domain name servers, however the resolv.conf file shows a nameserver of 127.0.1.1 which doesn't seem right to me.

Your help will be greatly appreciated.
0
Comment
Question by:JEaston
  • 4
  • 4
8 Comments
 
LVL 21

Expert Comment

by:Mazdajai
ID: 39219557
Did you use static ip in your guest Mint network configuration?

Try adding your DNS servers in resolv.conf -

nameserver 1.2.3.4

Open in new window

0
 
LVL 10

Author Comment

by:JEaston
ID: 39219590
I set the static IP under Network, then Wired Network, the IP v4 Tab.  I also set the DNS search and search domain here.

I tried added nameserver in resolv.conf but it is cleared when the server is restarted.  The file has the header:
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN

Open in new window


I should note that I am using the default GUI that came with Linux Mint which I believe is Cinnamon.
0
 
LVL 21

Expert Comment

by:Mazdajai
ID: 39219634
Sounds like Networkmanager is running. Try the following -

# No nameservers found; try putting DNS servers into your
# ifcfg files in /etc/sysconfig/network-scripts like so:
#
# DNS1=xxx.xxx.xxx.xxx
# DNS2=xxx.xxx.xxx.xxx
# DOMAIN=lab.foo.com bar.foo.com

Open in new window

0
 
LVL 10

Author Comment

by:JEaston
ID: 39219693
Where do I make this change?  I can't see a folder called sysconfig under etc.
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 21

Accepted Solution

by:
Mazdajai earned 500 total points
ID: 39219728
Sorry, the example was taken from Fedora. Mint is Debian family and it is under /etc/network/interfaces.
Use the following syntax instead -
dns-nameservers xxx.xxx.xxx.xxx xxx.xxx.xxx.xxx

Open in new window

0
 
LVL 21

Expert Comment

by:Mazdajai
ID: 39219733
0
 
LVL 10

Author Comment

by:JEaston
ID: 39219832
This had made some progress.  I also added a dns-domain entry.  The resolv.conf now shows the DNS servers I want, plus that 127.0.1.1 address.

Interestingly I can now ping the linux computer from my desktop, but it is still not listed in the DNS server (i.e. I cannot do an NSLookup).

Before giving the computer a static IP (i.e. it got one from DHCP) it did register in DNS - so I know it must be possible.

I think I'm going to call it a day for now and pick it up again tomorrow.
0
 
LVL 10

Author Comment

by:JEaston
ID: 39221632
It think in order to save time I will simply add the record manually to DNS.  It does mean that if I change the IP address in the future I will have to update DNS, but this is not going to happen too often I hope!
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

The purpose of this article is to demonstrate how we can use conditional statements using Python.
Resolve DNS query failed errors for Exchange
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to moveā€¦

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now