Reply

Override without Providing Current Name

Member
Posts: 2
2327     0

The way I currently update the name assigned to IPs is by using the override option and providing both the new and old name. Here's my format for that.

info3.JPG

 

This works as expected, removing the old name from the DNS entry and replacing it with the new name. However, I need a way to accomplish the above without providing the current name. To me, it should be able to key on the IP and replace whatever name currently exists with the name in my file. I'm not finding a way to accomplish this, though.

 

When I try to still use the override option, omitting the new name, I get the error "Fetching object failed due to The selected object could not be found". Here's the file for that.

info2.JPG

 

I've also tried using the io custom option. Strangely, what ends up happening is it will simply add the new name I've provided to the existing IP. Now, that IP resolves to 2 different names. I don't understand why this would occur. If I was using the im option, that would make sense, but not with the io option. Here's my file for that.

info1.JPG

 

Is it possible to accomplish what I'm trying to do or am I stuck having to provide the current name? Any help is appreciated. Thanks.

 

 

 

Re: Override without Providing Current Name

Adviser
Posts: 357
2328     0

It looks like the links for your images are broken. I am guessing that you are using the CSV Import feature to update objects, but I cannot tell what types of objects you are looking to update. If that is correct, I would recommend referring to the Infoblox CSV Import Reference Guide. You can find this through your Infoblox GUI by expanding the help panel on the right-hand side of the page, or by visiting the Infoblox Support portal (https://support.infoblox.com).

 

Most objects will have column that references the current name, along with one that would be used for a new name. Using an A record object as an example, the fqdn column would be used as the reference pointing to the current name, and the new name would be specified in the _new_fqdn column. This is how you would replace an existing name with a new name.

 

Regards,

Tony

Re: Override without Providing Current Name

Member
Posts: 2
2328     0

Hm. If I view the post when I'm not logged in, I cannot see the images. However, when I login, the images show with no problem. This is my first post. I've seen forums that don't allow links when you're a new member, but I uploaded this images to the forum, so not sure what the problem is.

 

Here's what I have in each of the images.

 

Image 1:

header-hostrecord | addresses          | fqdn                      | _new_fqdn                 | configure_for_dns

hostrecord            | 10.240.234.244 | tester.domain.com | newtesterdomain.com | true

 

Image 2:

header-hostrecord | addresses          | fqdn                            | configure_for_dns

hostrecord            | 10.240.234.244 | newtester.domain.com | true

 

Image 3:

header-hostrecord | import-action | addresses          | fqdn                           | configure_for_dns

hostrecord            | io                   | 10.240.234.244 | newtesterdomain.com | true

 

As stated in my original post, image 1 works as expected with the override option. In your post, you point on using this format. However, I'm wondering if it's possible to accomplish this without providing the existing fqdn and just provide the new fqdn.

 

What I want to do is overwrite whatever fqdn is currently assigned to that IP. I don't understand why I need to provide the existing IP and fqdn. It knows what fqdn is currently assigned to that IP, so I just want to overwrite with my new fqdn.

 

Images 2 & 3 were my attempts at trying to accomplish this, but of course didn't work. As mentioned in my previous post, image 2 gives the error 'object could not be found' when using the override option. For image 3, what it does is add my new fqdn to the existing record. This means that the IP resolves to be the existing fqdn and the new fqdn, which seems strange. The action is 'io', which is 'insert override', but it doesn't appear to override, so I'm not sure the purpose of this import action.

 

Hope this helps. Thanks.

Re: Override without Providing Current Name

Adviser
Posts: 162
2328     0

Hello There,

 

You cannot leave the “FQDN” field blank & that should have the *existing* FQDN of the DNS host object that you’re trying to modify. This requisite is specified in the CSV reference guide too(Look at page 54 from CSV reference guide for NIOS 8.2). So technically the error which you see is as expected. Now your requirement to replace *whatever* name assigned to a specific DNS host, is possible using Perl API. As an example :

 

 

use warnings;
use Infoblox;

 print "\n\nEnter the grid master IP : ";                          #Just making it ready to test in any grids..

my $masterip=<STDIN>;
chomp $masterip;

print "\nUsername : ";
my $username=<STDIN>;
chomp $username;

print "\nPassword : ";
my $password=<STDIN>;
chomp $password;

my $session = Infoblox::Session->new(master => $masterip, username => $username, password => $password, timeout=> "600");          #creating session

if ($session->status_code()) { die("\n\nSession failed", $session->status_code().":".$session->status_detail());}
 
print "\n\nSession established\n\n";

#getting the host from NIOS to match the specified IP.

my @fetch = $session->get(
object => "Infoblox::DNS::Host",
ipv4addr => "30.30.30.30"
);

my $object = $fetch[0];

unless ($object) {
die("Unable to locate host using the IPv4 reference: ",
$session->status_code() . ":" . $session->status_detail());
}

#Setting up the new name.

$object->name("newfqdn.zonetest.com");

#pushing the changes to the fetched host object.

$session->modify($object)

or die("Modify host record failed: ",

$session->status_code() . ":" . $session->status_detail());

print "DNS host object modified successfully \n";

 

Here, "zonetest.com" is one my existing zones & I do have a host record with "30.30.30.30" to be an IP address. You'll have to modify the script to make these changes to multiple hosts. I don't know whether API is an option for you. But CSV import cannot let you skip a mandatory field to be blank for sure. For additional reference on our API, please refer the guide available at https://support.infoblox.com/app/docs/d_token/0RLxggZZ-3E6P6mhfNcITISqqpbXQaxA5Lfc-v7vo8g

 

Best regards,

Mohammed Alman.

Showing results for 
Search instead for 
Did you mean: 

Recommended for You

Businesses are investing heavily into securing company resources from cyber-attacks form cybercrimin